petalbid-frontend
    Preparing search index...

    Variable userServiceConst

    userService: {
        adminChangePassword: (
            id: number,
            newPassword: string,
        ) => Promise<ApiResponse<{ message: string }>>;
        createUser: (data: RegisterUserRequest) => Promise<ApiResponse<User>>;
        deleteUser: (id: number) => Promise<ApiResponse<null>>;
        getAllUsers: (opts?: { force?: boolean }) => Promise<ApiResponse<User[]>>;
        updateUser: (id: number, data: Partial<User>) => Promise<ApiResponse<User>>;
    } = ...

    Service for user-related API calls (Admin only) with caching.

    Type Declaration

    • adminChangePassword: (id: number, newPassword: string) => Promise<ApiResponse<{ message: string }>>

      Resets a user's password.

    • createUser: (data: RegisterUserRequest) => Promise<ApiResponse<User>>

      Creates a new user (Admin only).

    • deleteUser: (id: number) => Promise<ApiResponse<null>>

      Deletes a user by ID and invalidates cache.

    • getAllUsers: (opts?: { force?: boolean }) => Promise<ApiResponse<User[]>>

      Fetches all users. Uses cache unless forced.

    • updateUser: (id: number, data: Partial<User>) => Promise<ApiResponse<User>>

      Updates a user by ID and invalidates cache.