[FEAT] Admin / ajout d'une partition doit pouvoir ajouter le numero dans
le PDF. #1
This commit is contained in:
@@ -6,7 +6,7 @@ import { get } from 'svelte/store';
|
||||
const API_BASE_URL_LOCAL = 'http://localhost:8000';
|
||||
const API_BASE_URL_PROD = 'https://ohmj-api.c.nadal-fr.com';
|
||||
|
||||
const API_BASE_URL = browser ? API_BASE_URL_PROD : API_BASE_URL_LOCAL;
|
||||
const API_BASE_URL = import.meta.env.DEV ? API_BASE_URL_LOCAL : API_BASE_URL_PROD;
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: API_BASE_URL,
|
||||
@@ -141,7 +141,7 @@ export const apiService = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async uploadPdf(scoreId: string, file: File, piece: string, instrument: string, version: string, key?: string, clef?: string, variant?: string, part?: string): Promise<{ success: boolean; path?: string; error?: string }> {
|
||||
async uploadPdf(scoreId: string, file: File, piece: string, instrument: string, version: string, key?: string, clef?: string, variant?: string, part?: string, watermark?: boolean, watermarkPosition?: 'left' | 'right'): Promise<{ success: boolean; path?: string; error?: string }> {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('piece', piece);
|
||||
@@ -151,6 +151,8 @@ export const apiService = {
|
||||
if (clef) formData.append('clef', clef);
|
||||
if (variant) formData.append('variant', variant);
|
||||
if (part) formData.append('part', part);
|
||||
if (watermark) formData.append('watermark', 'true');
|
||||
if (watermarkPosition) formData.append('watermarkPosition', watermarkPosition);
|
||||
|
||||
const response = await api.post(`/admin/scores/${scoreId}/upload`, formData, {
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user