Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4095330

Browse files
fix: use only template version ID to create task workspace (#18642)
When creating a new task, the following error was getting returned:**Error:**```json{ "message": "Validation failed.", "validations": [ { "field": "template_id", "detail": "Validation failed for tag \"excluded_with\" with value: \"42205a38-845c-4186-8475-f002e0936d53\"" }, { "field": "template_version_id", "detail": "Validation failed for tag \"excluded_with\" with value: \"22b1c4b7-432d-4eb5-9341-cd8efacb8f46\"" } ]}```Caused by#18623
1 parentd4208d2 commit4095330

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

‎site/src/pages/TasksPage/TasksPage.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ const TaskFormSection: FC<{
206206
);
207207
};
208208

209-
typeCreateTaskMutationFnProps={prompt:string;template:Template};
209+
typeCreateTaskMutationFnProps={prompt:string;templateVersionId:string};
210210

211211
typeTaskFormProps={
212212
templates:Template[];
@@ -236,8 +236,11 @@ const TaskForm: FC<TaskFormProps> = ({ templates, onSuccess }) => {
236236
:true;
237237

238238
constcreateTaskMutation=useMutation({
239-
mutationFn:async({ prompt, template}:CreateTaskMutationFnProps)=>
240-
data.createTask(prompt,user.id,template.id,template.active_version_id),
239+
mutationFn:async({
240+
prompt,
241+
templateVersionId,
242+
}:CreateTaskMutationFnProps)=>
243+
data.createTask(prompt,user.id,templateVersionId),
241244
onSuccess:async(task)=>{
242245
awaitqueryClient.invalidateQueries({
243246
queryKey:["tasks"],
@@ -257,7 +260,7 @@ const TaskForm: FC<TaskFormProps> = ({ templates, onSuccess }) => {
257260
try{
258261
awaitcreateTaskMutation.mutateAsync({
259262
prompt,
260-
template:selectedTemplate,
263+
templateVersionId:selectedTemplate.active_version_id,
261264
});
262265
}catch(error){
263266
constmessage=getErrorMessage(error,"Error creating task");
@@ -600,14 +603,12 @@ export const data = {
600603
asynccreateTask(
601604
prompt:string,
602605
userId:string,
603-
templateId:string,
604606
templateVersionId:string,
605607
):Promise<Task>{
606608
constpresets=awaitAPI.getTemplateVersionPresets(templateVersionId);
607609
constdefaultPreset=presets.find((p)=>p.Default);
608610
constworkspace=awaitAPI.createWorkspace(userId,{
609611
name:`task-${generateWorkspaceName()}`,
610-
template_id:templateId,
611612
template_version_id:templateVersionId,
612613
template_version_preset_id:defaultPreset?.ID,
613614
rich_parameter_values:[

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp