Files
co-lite/solvway-admin-portal/app/lib/services/adminRoles.ts
T
ngqileandClaude Opus 5.5 8ce9fcf471 feat: portal password hints, company hint, interest and role delete, dashboard notes
- Login: company-code hint after an invalid-credentials failure with an empty company.
- Password forms show the active rules (label-first, count-safe) and tie hint and refusal to the input.
- Interests and roles: soft delete with confirm dialogs; deactivate now confirms too.
- Dashboard figure explanations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-12-02 02:59:44 +08:00

19 lines
707 B
TypeScript

import { apiGet, apiPost, apiPut, apiDelete } from "@/app/lib/clientApi";
import type { AdminRoleEntity } from "@/app/lib/types";
export async function listAdminRoles(): Promise<AdminRoleEntity[]> {
return apiGet<AdminRoleEntity[]>("/api/roles");
}
export async function getAdminRole(id: number): Promise<AdminRoleEntity> {
return apiGet<AdminRoleEntity>(`/api/roles/${id}`);
}
export async function saveAdminRole(payload: AdminRoleEntity): Promise<AdminRoleEntity> {
return payload.id
? apiPut<AdminRoleEntity>(`/api/roles/${payload.id}`, payload)
: apiPost<AdminRoleEntity>("/api/roles", payload);
}
export const deleteAdminRole = (id: number) => apiDelete<unknown>(`/api/roles/${id}`);