mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
17 lines
511 B
TypeScript
17 lines
511 B
TypeScript
import { handleError } from '$lib/utils/handle-error';
|
|
import { getFormatter } from '$lib/utils/i18n';
|
|
import { createJob, type JobCreateDto } from '@immich/sdk';
|
|
import { toastManager } from '@immich/ui';
|
|
|
|
export const handleCreateJob = async (dto: JobCreateDto) => {
|
|
const $t = await getFormatter();
|
|
|
|
try {
|
|
await createJob({ jobCreateDto: dto });
|
|
toastManager.success($t('admin.job_created'));
|
|
return true;
|
|
} catch (error) {
|
|
handleError(error, $t('errors.unable_to_submit_job'));
|
|
}
|
|
};
|