mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-10-09 22:03:36 +02:00
fix return statement
This commit is contained in:
@@ -125,13 +125,12 @@ export const generateGptResponse: GenerateGptResponse<GptPayload, RelatedObject>
|
|||||||
|
|
||||||
const json = (await response.json()) as OpenAIResponse;
|
const json = (await response.json()) as OpenAIResponse;
|
||||||
console.log('response json', json);
|
console.log('response json', json);
|
||||||
const res = await context.entities.RelatedObject.create({
|
return context.entities.RelatedObject.create({
|
||||||
data: {
|
data: {
|
||||||
content: json?.choices[0].message.content,
|
content: json?.choices[0].message.content,
|
||||||
user: { connect: { id: context.user.id } },
|
user: { connect: { id: context.user.id } },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return res;
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (!context.user.hasPaid && error?.statusCode != 402) {
|
if (!context.user.hasPaid && error?.statusCode != 402) {
|
||||||
await context.entities.User.update({
|
await context.entities.User.update({
|
||||||
|
Reference in New Issue
Block a user