feature/25-dtos #7

Merged
william merged 2 commits from feature/25-dtos into develop 2022-04-20 22:52:51 -04:00
3 changed files with 8 additions and 6 deletions
Showing only changes of commit cc24423389 - Show all commits

View File

@ -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) {

View File

@ -1,4 +1,5 @@
export const environment = {
production: true,
apiBaseUrl: window.location.origin,
apiUrl: window.location.origin + '/api'
};

View File

@ -4,6 +4,7 @@
export const environment = {
production: false,
apiBaseUrl: 'http://localhost:9090',
apiUrl: 'http://localhost:9090/api'
};