From 0e89d662abce8f9382b8e8bee5d9d00827d2d7e0 Mon Sep 17 00:00:00 2001 From: Johnson Liang Date: Mon, 28 Aug 2023 13:44:06 +0800 Subject: [PATCH] fix(graphql): enforce user to be provided when createTranscript --- src/graphql/util.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/graphql/util.js b/src/graphql/util.js index 109d9915..e9361ee3 100644 --- a/src/graphql/util.js +++ b/src/graphql/util.js @@ -688,8 +688,11 @@ const imageAnnotator = new ImageAnnotatorClient(); /** * @param {object} queryInfo - contains type and media entry ID of contents after fileUrl * @param {string} fileUrl - the audio, image or video file to process + * @param {object} user - the user who requested the transcription */ export async function createTranscript(queryInfo, fileUrl, user) { + if (!user) throw new Error('[createTranscript] user is required'); + const update = createAIResponse({ user, type: 'TRANSCRIPT',