From 10f1ef9185ad5368f851bb304f2b34cef471633c Mon Sep 17 00:00:00 2001 From: Mahdi Date: Sat, 13 Jun 2026 16:49:49 +0330 Subject: [PATCH] edit ios & api --- index.html | 2 +- src/api/types.ts | 7 +++ src/api/users.ts | 9 +++- src/components/shell/AppShell.vue | 10 ++-- src/layouts/AdminLayout.vue | 6 +-- src/styles/main.css | 24 ++++++++++ src/views/UsersView.vue | 77 +++++++++++++++++++++++++++---- 7 files changed, 118 insertions(+), 17 deletions(-) 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 @@