fix: civitai picker
This commit is contained in:
		
							parent
							
								
									757c587901
								
							
						
					
					
						commit
						d96811a0c3
					
				@ -27,7 +27,8 @@ export function mapModelsList(
 | 
				
			|||||||
          description: item.description,
 | 
					          description: item.description,
 | 
				
			||||||
          reference: "",
 | 
					          reference: "",
 | 
				
			||||||
          filename: v.files[0].name,
 | 
					          filename: v.files[0].name,
 | 
				
			||||||
          url: v.files[0].downloadUrl,
 | 
					          // Quick hack to get the download url back as normal url
 | 
				
			||||||
 | 
					          url: `https://civitai.com/models/${v.modelId}?modelVersionId=${v.id}`, //v.files[0].downloadUrl,
 | 
				
			||||||
        } as z.infer<typeof Model>;
 | 
					        } as z.infer<typeof Model>;
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    }),
 | 
					    }),
 | 
				
			||||||
 | 
				
			|||||||
@ -61,7 +61,8 @@ function ModelPickerView({
 | 
				
			|||||||
}: Pick<AutoFormInputComponentProps, "field" | "fieldProps">) {
 | 
					}: Pick<AutoFormInputComponentProps, "field" | "fieldProps">) {
 | 
				
			||||||
  const customOverride = React.useMemo(() => {
 | 
					  const customOverride = React.useMemo(() => {
 | 
				
			||||||
    const customOnChange = (value: z.infer<typeof ModelList>) => {
 | 
					    const customOnChange = (value: z.infer<typeof ModelList>) => {
 | 
				
			||||||
      field.onChange(value[0]?.url);
 | 
					      const model = value[0];
 | 
				
			||||||
 | 
					      field.onChange(model?.url);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
      ...field,
 | 
					      ...field,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user