feature/25-dtos #7
|
@ -10,20 +10,20 @@ export function valueOr<T>(value: T, or: T): T {
|
|||
const MEDIA_TYPE_PDF = 'application/pdf'
|
||||
const MEDIA_TYPE_JPG = 'image/jpeg'
|
||||
|
||||
export function openPdf(url: string) {
|
||||
openUrl(url, MEDIA_TYPE_PDF)
|
||||
export function openPdf(uri: string) {
|
||||
openFileUri(uri, MEDIA_TYPE_PDF)
|
||||
}
|
||||
|
||||
export function openJpg(url: string) {
|
||||
openUrl(url, MEDIA_TYPE_JPG)
|
||||
export function openJpg(uri: string) {
|
||||
openFileUri(uri, MEDIA_TYPE_JPG)
|
||||
}
|
||||
|
||||
export function openTouchUpKit(touchUpKit: TouchUpKit) {
|
||||
openRawUrl(`${environment.apiUrl}/touchupkit/pdf?project=${touchUpKit.project}`)
|
||||
}
|
||||
|
||||
export function openUrl(url: string, mediaType: string) {
|
||||
openRawUrl(`${url}&mediaType=${encodeURIComponent(mediaType)}`)
|
||||
export function openFileUri(uri: string, mediaType: string) {
|
||||
openRawUrl(`${environment.apiBaseUrl}${uri}&mediaType=${encodeURIComponent(mediaType)}`)
|
||||
}
|
||||
|
||||
export function openRawUrl(url: string) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export const environment = {
|
||||
production: true,
|
||||
apiBaseUrl: window.location.origin,
|
||||
apiUrl: window.location.origin + '/api'
|
||||
};
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiBaseUrl: 'http://localhost:9090',
|
||||
apiUrl: 'http://localhost:9090/api'
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue