payment-backoffice/services/roles.services.ts
2025-07-14 19:58:58 +02:00

16 lines
436 B
TypeScript

import { IEditUserForm } from "@/app/features/UserRoles/User.interfaces";
export async function createRole(data: IEditUserForm) {
const res = await fetch("/api/dashboard/admin/users", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
});
if (!res.ok) {
throw new Error("Failed to create role");
}
return res.json(); // or return type depending on your backend
}