Fix TypeScript errors in syncController — cast Date arguments to String
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -138,7 +138,7 @@ export const syncStatus = async (req: AuthRequest, res: Response) => {
|
|||||||
const clientUpdatedAt = clientEndpointMap.get(ep.id);
|
const clientUpdatedAt = clientEndpointMap.get(ep.id);
|
||||||
if (!clientUpdatedAt) {
|
if (!clientUpdatedAt) {
|
||||||
newEndpoints.push({ id: ep.id, name: ep.name });
|
newEndpoints.push({ id: ep.id, name: ep.name });
|
||||||
} else if (new Date(ep.updated_at).getTime() > new Date(clientUpdatedAt).getTime()) {
|
} else if (new Date(String(ep.updated_at)).getTime() > new Date(String(clientUpdatedAt)).getTime()) {
|
||||||
changedEndpoints.push({ id: ep.id, name: ep.name, server_updated_at: ep.updated_at });
|
changedEndpoints.push({ id: ep.id, name: ep.name, server_updated_at: ep.updated_at });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ export const syncStatus = async (req: AuthRequest, res: Response) => {
|
|||||||
const clientUpdatedAt = clientFolderMap.get(f.id);
|
const clientUpdatedAt = clientFolderMap.get(f.id);
|
||||||
if (!clientUpdatedAt) {
|
if (!clientUpdatedAt) {
|
||||||
newFolders.push({ id: f.id, name: f.name });
|
newFolders.push({ id: f.id, name: f.name });
|
||||||
} else if (new Date(f.updated_at).getTime() > new Date(clientUpdatedAt).getTime()) {
|
} else if (new Date(String(f.updated_at)).getTime() > new Date(String(clientUpdatedAt)).getTime()) {
|
||||||
changedFolders.push({ id: f.id, name: f.name, server_updated_at: f.updated_at });
|
changedFolders.push({ id: f.id, name: f.name, server_updated_at: f.updated_at });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user