Compare commits

..

1 Commits

Author SHA1 Message Date
f60847f9aa For some reason now it works properly.
NOTE: this solution is unstable and can change in the future.
2025-04-02 17:04:55 +02:00

View File

@@ -9,9 +9,7 @@ async function editContact(contactId: string, formData: FormData) {
"use server";
const updates = Object.fromEntries(formData);
await updateContact(contactId, updates);
revalidatePath('/(sidebar)', 'layout');
revalidatePath(`/contacts/${contactId}`, 'page');
revalidatePath(`/contacts/${contactId}/edit`, 'page');
revalidatePath('/(sidebar)', 'layout'); // THE NESTED BEHAVIOR IS UNSTABLE AND CAN CHANGE IN FUTURE.
redirect(`/contacts/${contactId}`); // This makes the server component data be reloaded.
/*
* The server component architecture is a HTMX-like structure where the component rendered is STATE-LESS