diff --git a/services/curatorPhoto.service.ts b/services/utilities.service.ts similarity index 82% rename from services/curatorPhoto.service.ts rename to services/utilities.service.ts index 6197dc82..606a56b1 100644 --- a/services/curatorPhoto.service.ts +++ b/services/utilities.service.ts @@ -4,7 +4,7 @@ import {CustomOptions} from './servicesUtils/customOptions.class'; import {HttpClient} from '@angular/common/http'; @Injectable() -export class CuratorPhotoService { +export class UtilitiesService { constructor(private http: HttpClient) { } @@ -18,4 +18,8 @@ export class CuratorPhotoService { return this.http.delete(url, CustomOptions.getAuthOptions()); } + getTiny(url: string) { + return this.http.get(url, {responseType: 'text'}); + } + } diff --git a/utils/HelperFunctions.class.ts b/utils/HelperFunctions.class.ts index b4a76069..9ebcb542 100644 --- a/utils/HelperFunctions.class.ts +++ b/utils/HelperFunctions.class.ts @@ -8,4 +8,8 @@ export class HelperFunctions { window.scrollTo(0, 0); } } -} \ No newline at end of file + + public static isTiny(url: string) { + return (url.indexOf('tinyurl.com') !== -1); + } +} diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 6678e3c7..317c6c2f 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -58,6 +58,7 @@ export class EnvProperties { uploadService; downloadUrl; deleteUrl; + tinyUrl; vocabulariesAPI;