- 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
19 lines
707 B
TypeScript
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}`);
|