fix: deleteDocumentServer signature compatibility
This commit is contained in:
parent
3abaa7602f
commit
76436ac1a2
@ -40,11 +40,17 @@ export async function updateDocumentServer(collectionId: string, documentId: str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteDocumentServer(collectionId: string, documentId: string) {
|
export async function deleteDocumentServer(collectionId: string, documentId: string, entityAlias?: string) {
|
||||||
try {
|
try {
|
||||||
const client = getAdminClient();
|
const client = getAdminClient();
|
||||||
const databases = new Databases(client);
|
const databases = new Databases(client);
|
||||||
const result = await databases.deleteDocument(DATABASE_ID, collectionId, documentId);
|
const result = await databases.deleteDocument(DATABASE_ID, collectionId, documentId);
|
||||||
|
|
||||||
|
// Si hay un alias de entidad, podemos revalidar su ruta específica
|
||||||
|
if (entityAlias) {
|
||||||
|
revalidatePath(`/dashboard/${entityAlias}`);
|
||||||
|
}
|
||||||
|
|
||||||
revalidatePath('/');
|
revalidatePath('/');
|
||||||
return { success: true, data: result };
|
return { success: true, data: result };
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user