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