This commit is contained in:
xuyue committed 2026-03-31 02:21:40 -06:00
1 parent 3c721224c8
commit 85e1681017
9 files changed
+46 -141

No files matched your search

+12 -3
View File
@@ -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 = {