diff --git a/index.html b/index.html index 0caae71..2aeecc2 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + منتایم — پنل مدیریت diff --git a/src/api/types.ts b/src/api/types.ts index 2cd7b0e..01ed1ea 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -11,6 +11,13 @@ export type User = { updatedAt?: string; }; +export type CreateUserPayload = { + mobile: string; + fullName?: string | null; + role?: UserRole; + isActive?: boolean; +}; + export type UpdateUserPayload = { fullName?: string | null; role?: UserRole; diff --git a/src/api/users.ts b/src/api/users.ts index 2030bc6..d88e19f 100644 --- a/src/api/users.ts +++ b/src/api/users.ts @@ -1,10 +1,17 @@ import { api } from './client'; -import type { AdminSetUserPasswordPayload, UpdateUserPayload, User } from './types'; +import type { AdminSetUserPasswordPayload, CreateUserPayload, UpdateUserPayload, User } from './types'; export function fetchUsers() { return api('/users'); } +export function createUser(payload: CreateUserPayload) { + return api('/users', { + method: 'POST', + body: JSON.stringify(payload), + }); +} + export function fetchUser(id: string) { return api(`/users/${id}`); } diff --git a/src/components/shell/AppShell.vue b/src/components/shell/AppShell.vue index 555785a..f00f660 100644 --- a/src/components/shell/AppShell.vue +++ b/src/components/shell/AppShell.vue @@ -1,7 +1,9 @@ diff --git a/src/layouts/AdminLayout.vue b/src/layouts/AdminLayout.vue index 9774d15..655a377 100644 --- a/src/layouts/AdminLayout.vue +++ b/src/layouts/AdminLayout.vue @@ -1,7 +1,7 @@