Skip to content

Commit ddccc4e

Browse files
author
Marvin Zhang
committed
feat: enhance Dialog component with appendToBody option
- Added appendToBody property to Dialog component for improved rendering flexibility - Updated service methods to wrap form data in a data object for consistency
1 parent d21f292 commit ddccc4e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/ui/dialog/Dialog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ withDefaults(
2020
{
2121
top: '15vh',
2222
confirmType: 'primary',
23+
appendToBody: true,
2324
}
2425
);
2526

src/services/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ export const useService = <T = any>(endpoint: string): Services<T> => {
1414
return await get<T>(`${endpoint}/${id}`);
1515
}) as any,
1616
create: async (form: T) => {
17-
return await post<T>(`${endpoint}`, form);
17+
return await post<{ data: T }, ResponseWithData<T>>(`${endpoint}`, {
18+
data: form,
19+
});
1820
},
1921
updateById: async (id: string, form: T) => {
20-
return await put<T>(`${endpoint}/${id}`, form);
22+
return await put<{ data: T }, ResponseWithData<T>>(`${endpoint}/${id}`, {
23+
data: form,
24+
});
2125
},
2226
deleteById: async (id: string) => {
2327
return await del(`${endpoint}/${id}`);

0 commit comments

Comments
 (0)