fix: rename sidecar() helper → callSidecar() and fix mariadb healthcheck
The new `const sidecar` axios instance (added in 243e5d3) clashed with the
pre-existing `async function sidecar()` fetch helper, causing `npm run build`
to fail with a rolldown redeclaration error. Rename the fetch helper and all
its call sites to `callSidecar`.
Also replace the mariadb healthcheck command: `healthcheck.sh` calls the
`mariadb` CLI which isn't on PATH in the current image layer, causing the
container to stay permanently unhealthy and the deploy webhook to abort before
the `npm run build` step runs — leaving the old JS bundle serving from nginx.
Switch to `mysqladmin ping` which is available in all MariaDB 11 images.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -529,7 +529,7 @@ export async function listFolderCounts(paths: string[]): Promise<Record<string,
|
||||
// on the way out, then re-key the response back to user-relative on
|
||||
// the way in so callers' map keys line up with their input array.
|
||||
const serverPaths = paths.map((p) => toOriginalsPath(p));
|
||||
const data = (await sidecar('POST', '/folders/counts', { paths: serverPaths })) as Record<
|
||||
const data = (await callSidecar('POST', '/folders/counts', { paths: serverPaths })) as Record<
|
||||
string,
|
||||
number
|
||||
>;
|
||||
@@ -875,7 +875,7 @@ export interface RenameResult {
|
||||
newRelPath: string;
|
||||
}
|
||||
|
||||
async function sidecar(method: string, urlPath: string, body?: unknown): Promise<unknown> {
|
||||
async function callSidecar(method: string, urlPath: string, body?: unknown): Promise<unknown> {
|
||||
const res = await fetch(`/api/sidecar${urlPath}`, {
|
||||
method,
|
||||
headers: {
|
||||
@@ -893,20 +893,20 @@ async function sidecar(method: string, urlPath: string, body?: unknown): Promise
|
||||
}
|
||||
|
||||
export async function createFolder(relPath: string): Promise<{ path: string }> {
|
||||
return sidecar('POST', '/folders', { path: relPath }) as Promise<{ path: string }>;
|
||||
return callSidecar('POST', '/folders', { path: relPath }) as Promise<{ path: string }>;
|
||||
}
|
||||
|
||||
export async function renameFolder(
|
||||
relPath: string,
|
||||
newName: string
|
||||
): Promise<{ oldPath: string; newPath: string }> {
|
||||
return sidecar('POST', `/folders/${encodeURIComponent(relPath)}/rename`, {
|
||||
return callSidecar('POST', `/folders/${encodeURIComponent(relPath)}/rename`, {
|
||||
newName
|
||||
}) as Promise<{ oldPath: string; newPath: string }>;
|
||||
}
|
||||
|
||||
export async function deleteFolder(relPath: string): Promise<{ path: string }> {
|
||||
return sidecar('DELETE', `/folders/${encodeURIComponent(relPath)}`) as Promise<{
|
||||
return callSidecar('DELETE', `/folders/${encodeURIComponent(relPath)}`) as Promise<{
|
||||
path: string;
|
||||
}>;
|
||||
}
|
||||
@@ -939,7 +939,7 @@ export interface CrossFolderScanResult {
|
||||
}
|
||||
|
||||
export async function scanCrossFolderDuplicates(): Promise<CrossFolderScanResult> {
|
||||
return sidecar('GET', '/duplicates/scan') as Promise<CrossFolderScanResult>;
|
||||
return callSidecar('GET', '/duplicates/scan') as Promise<CrossFolderScanResult>;
|
||||
}
|
||||
|
||||
export interface ArchiveDuplicatesResult {
|
||||
@@ -950,7 +950,7 @@ export interface ArchiveDuplicatesResult {
|
||||
export async function archiveDuplicatePaths(
|
||||
paths: string[]
|
||||
): Promise<ArchiveDuplicatesResult> {
|
||||
return sidecar('POST', '/duplicates/archive', { paths }) as Promise<ArchiveDuplicatesResult>;
|
||||
return callSidecar('POST', '/duplicates/archive', { paths }) as Promise<ArchiveDuplicatesResult>;
|
||||
}
|
||||
|
||||
// ── Heap convert (move/copy heap photos to a folder) ────────────────────────
|
||||
@@ -982,7 +982,7 @@ export async function convertHeap(
|
||||
uid: string,
|
||||
body: HeapConvertBody
|
||||
): Promise<HeapConvertResult> {
|
||||
return sidecar('POST', `/albums/${uid}/convert`, body) as Promise<HeapConvertResult>;
|
||||
return callSidecar('POST', `/albums/${uid}/convert`, body) as Promise<HeapConvertResult>;
|
||||
}
|
||||
|
||||
// ── Photo marks (rating + color) ─────────────────────────────────────────────
|
||||
@@ -998,19 +998,19 @@ export interface PhotoMark {
|
||||
export type PhotoMarksMap = Record<string, PhotoMark>;
|
||||
|
||||
export async function getAllMarks(): Promise<PhotoMarksMap> {
|
||||
const data = await sidecar('GET', '/photos/marks');
|
||||
const data = await callSidecar('GET', '/photos/marks');
|
||||
return (data ?? {}) as PhotoMarksMap;
|
||||
}
|
||||
|
||||
export async function setMark(photoUid: string, patch: PhotoMark): Promise<PhotoMark> {
|
||||
return sidecar('PUT', `/photos/${photoUid}/marks`, patch) as Promise<PhotoMark>;
|
||||
return callSidecar('PUT', `/photos/${photoUid}/marks`, patch) as Promise<PhotoMark>;
|
||||
}
|
||||
|
||||
export async function bulkSetMarks(
|
||||
ids: string[],
|
||||
patch: PhotoMark
|
||||
): Promise<{ count: number; marks: PhotoMarksMap }> {
|
||||
return sidecar('POST', '/photos/marks/bulk', { ids, patch }) as Promise<{
|
||||
return callSidecar('POST', '/photos/marks/bulk', { ids, patch }) as Promise<{
|
||||
count: number;
|
||||
marks: PhotoMarksMap;
|
||||
}>;
|
||||
|
||||
Reference in New Issue
Block a user