Skip to content

Commit 287c14c

Browse files
authored
fix: add json parse to read as array (#15)
* fix: add json parse to read as array * fix: add a check to see if json parse needed
1 parent 9f20f54 commit 287c14c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/feedback/models/feedbackManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export class FeedbackManager {
1919
public async createFeedback(feedback: IFeedbackModel, apiKey: string): Promise<FeedbackResponse> {
2020
const requestId = feedback.request_id;
2121
const userId = feedback.user_id;
22-
const userValidation = this.config.get<string[]>('application.userValidation');
22+
const raw = this.config.get<string | string[]>('application.userValidation');
23+
const userValidation = Array.isArray(raw) ? raw : (JSON.parse(raw) as string[]);
2324
const ttl = this.config.get<number>('redis.ttl');
2425
const prefix = this.config.has('redis.prefix') ? this.config.get<string>('redis.prefix') : undefined;
2526

0 commit comments

Comments
 (0)