fixed some ui, upgrade functionalitym added permission to operator
This commit is contained in:
@@ -18,7 +18,11 @@ export interface AddPermissionRolePayload {
|
||||
roleId: number;
|
||||
}
|
||||
|
||||
export type AddPermissionUserPayload = AddPermissionRolePayload;
|
||||
export interface AddPermissionUserPayload {
|
||||
permissionId: number;
|
||||
userId: number;
|
||||
effect?: string;
|
||||
}
|
||||
|
||||
// Re-export so shared hooks can import from one place
|
||||
export type { BranchListParams, BranchListResponse };
|
||||
@@ -76,7 +80,17 @@ export async function postPermissionRole(payload: AddPermissionRolePayload): Pro
|
||||
await apiClient.post("/permission-roles", payload);
|
||||
}
|
||||
|
||||
export const postPermissionUser = postPermissionRole;
|
||||
/**
|
||||
* POST /permission-users
|
||||
* Assigns a permission to a user.
|
||||
*/
|
||||
export async function postPermissionUser(payload: AddPermissionUserPayload): Promise<void> {
|
||||
await apiClient.post("/permission-users", {
|
||||
permissionId: payload.permissionId,
|
||||
userId: payload.userId,
|
||||
effect: payload.effect ?? "allow",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Proxy for branch list fetching — kept here so shared hooks
|
||||
|
||||
Reference in New Issue
Block a user