feat: 修改产品编辑功能,更新请求类型为PUT;修复表单数据初始化
This commit is contained in:
@@ -13,7 +13,7 @@ const emit = defineEmits<{
|
||||
(e: 'close'): void;
|
||||
}>();
|
||||
|
||||
type Body = CommonType.TreatyBody<typeof client.api.admin.rwa.issuance.products.post>;
|
||||
type Body = CommonType.TreatyBody<typeof client.api.admin.rwa.issuance.products.put>;
|
||||
|
||||
const formInst = useTemplateRef<FormInst>('formInst');
|
||||
const { data: categories } = safeClient(
|
||||
@@ -26,6 +26,7 @@ const { data: categories } = safeClient(
|
||||
);
|
||||
|
||||
const form = ref<Body>({
|
||||
id: props.data.id,
|
||||
name: props.data.name,
|
||||
code: props.data.code,
|
||||
categoryId: props.data.categoryId,
|
||||
@@ -47,7 +48,7 @@ function handleSubmit() {
|
||||
formInst.value?.validate(async errors => {
|
||||
if (!errors) {
|
||||
await safeClient(
|
||||
client.api.admin.rwa.issuance.products.post({
|
||||
client.api.admin.rwa.issuance.products.put({
|
||||
...form.value
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user