fix
This commit is contained in:
15
src/api.ts
15
src/api.ts
@@ -157,14 +157,14 @@ export const Submission = {
|
||||
html?: string
|
||||
css?: string
|
||||
js?: string
|
||||
conversationId?: string
|
||||
prompt?: string
|
||||
},
|
||||
) {
|
||||
const { conversationId, ...rest } = code
|
||||
const { prompt, ...rest } = code
|
||||
const data = {
|
||||
task_id: taskId,
|
||||
...rest,
|
||||
conversation_id: conversationId || null,
|
||||
prompt: prompt || null,
|
||||
}
|
||||
const res = await http.post("/submission/", data)
|
||||
return res.data
|
||||
@@ -250,6 +250,15 @@ export const Prompt = {
|
||||
)
|
||||
).data
|
||||
},
|
||||
|
||||
async getMessagesByUserTask(
|
||||
taskId: number,
|
||||
userId: number,
|
||||
): Promise<PromptMessage[]> {
|
||||
const convs = await this.listConversations(taskId, userId)
|
||||
if (!convs.length) return []
|
||||
return this.getMessages(convs[0].id)
|
||||
},
|
||||
}
|
||||
|
||||
export const Helper = {
|
||||
|
||||
Reference in New Issue
Block a user