Refactoring of routes
group functionalities working
This commit is contained in:
@@ -16,12 +16,12 @@ export async function fetchGroups() {
|
||||
|
||||
export async function deleteGroup(groupName: string) {
|
||||
// Passe ggf. an deine API an
|
||||
return fetch(`/api/groups/${encodeURIComponent(groupName)}`, { method: 'DELETE' });
|
||||
return fetch(`/api/groups/byname/${encodeURIComponent(groupName)}`, { method: 'DELETE' });
|
||||
}
|
||||
|
||||
export async function renameGroup(oldName: string, newName: string) {
|
||||
// Passe ggf. an deine API an
|
||||
return fetch(`/api/groups/${encodeURIComponent(oldName)}`, {
|
||||
return fetch(`/api/groups/byname/${encodeURIComponent(oldName)}`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ newName }),
|
||||
|
||||
@@ -8,7 +8,7 @@ const Dashboard: React.FC = () => {
|
||||
useEffect(() => {
|
||||
fetchClients().then(setClients).catch(console.error);
|
||||
}, []);
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<header className="mb-8 pb-4 border-b-2 border-[#d6c3a6]">
|
||||
|
||||
Reference in New Issue
Block a user