260312:0932 20260312:0930 n8n workflow, backend and frontend MOD.
Build and Deploy / deploy (push) Failing after 3m34s
Build and Deploy / deploy (push) Failing after 3m34s
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import api from '../api';
|
||||
import {
|
||||
MigrationReviewQueueItem,
|
||||
MigrationErrorItem,
|
||||
PaginatedResponse,
|
||||
MigrationReviewStatus,
|
||||
} from '@/types/migration';
|
||||
|
||||
export const migrationService = {
|
||||
getReviewQueue: async (params: {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
status?: MigrationReviewStatus;
|
||||
}): Promise<PaginatedResponse<MigrationReviewQueueItem>> => {
|
||||
const { data } = await api.get('/migration/queue', { params });
|
||||
return data;
|
||||
},
|
||||
|
||||
getQueueItem: async (id: number): Promise<MigrationReviewQueueItem> => {
|
||||
const { data } = await api.get(`/migration/queue/${id}`);
|
||||
return data;
|
||||
},
|
||||
|
||||
getErrors: async (params: {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}): Promise<PaginatedResponse<MigrationErrorItem>> => {
|
||||
const { data } = await api.get('/migration/errors', { params });
|
||||
return data;
|
||||
},
|
||||
|
||||
approveQueueItem: async (id: number, payload: any, idempotencyKey: string) => {
|
||||
const { data } = await api.post(`/migration/queue/${id}/approve`, payload, {
|
||||
headers: {
|
||||
'idempotency-key': idempotencyKey,
|
||||
},
|
||||
});
|
||||
return data;
|
||||
},
|
||||
|
||||
rejectQueueItem: async (id: number) => {
|
||||
const { data } = await api.post(`/migration/queue/${id}/reject`);
|
||||
return data;
|
||||
},
|
||||
|
||||
getStagingFileUrl: (filePath: string) => {
|
||||
// Generate the URL directly since it returns a file stream.
|
||||
// Ensure we encode the file path correctly.
|
||||
// It assumes your axios baseURL is set to your nestjs API.
|
||||
// If working with raw <img> or <iframe>, you might need to append the token,
|
||||
// or handle it via a fetch wrapper that downloads creating an object URL.
|
||||
return `/api/migration/staging-file?path=${encodeURIComponent(filePath)}`;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user