feat: add worker operations and fix gitea actions
Some checks failed
docker-images / build-and-push (admin, admin, termi-astro-admin, admin/Dockerfile) (push) Successful in 29s
docker-images / build-and-push (backend, backend, termi-astro-backend, backend/Dockerfile) (push) Successful in 33m13s
docker-images / build-and-push (frontend, frontend, termi-astro-frontend, frontend/Dockerfile) (push) Successful in 58s
ui-regression / playwright-regression (push) Failing after 13m24s
Some checks failed
docker-images / build-and-push (admin, admin, termi-astro-admin, admin/Dockerfile) (push) Successful in 29s
docker-images / build-and-push (backend, backend, termi-astro-backend, backend/Dockerfile) (push) Successful in 33m13s
docker-images / build-and-push (frontend, frontend, termi-astro-frontend, frontend/Dockerfile) (push) Successful in 58s
ui-regression / playwright-regression (push) Failing after 13m24s
This commit is contained in:
@@ -47,6 +47,51 @@ export function resolveFileRef(ref: string): string {
|
||||
return `/uploads/${ref}`;
|
||||
}
|
||||
|
||||
function resolveTaxonomyToken(
|
||||
value:
|
||||
| string
|
||||
| null
|
||||
| undefined
|
||||
| {
|
||||
slug?: string | null;
|
||||
name?: string | null;
|
||||
},
|
||||
): string {
|
||||
if (typeof value === 'string') {
|
||||
return value.trim();
|
||||
}
|
||||
|
||||
return (value?.slug || value?.name || '').trim();
|
||||
}
|
||||
|
||||
export function buildCategoryUrl(
|
||||
value:
|
||||
| string
|
||||
| null
|
||||
| undefined
|
||||
| {
|
||||
slug?: string | null;
|
||||
name?: string | null;
|
||||
},
|
||||
): string {
|
||||
const token = resolveTaxonomyToken(value);
|
||||
return token ? `/categories/${encodeURIComponent(token)}` : '/categories';
|
||||
}
|
||||
|
||||
export function buildTagUrl(
|
||||
value:
|
||||
| string
|
||||
| null
|
||||
| undefined
|
||||
| {
|
||||
slug?: string | null;
|
||||
name?: string | null;
|
||||
},
|
||||
): string {
|
||||
const token = resolveTaxonomyToken(value);
|
||||
return token ? `/tags/${encodeURIComponent(token)}` : '/tags';
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a unique ID
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user