diff --git a/changelog.md b/changelog.md index a603b36..6f6cd64 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,14 @@ CHANGELOG ========= +1.1.1+dev (unreleased) +---------------------- + +**Bugfix** + +- Revert changes about NG_APP_API_URL. No need to change it in production environments. + + 1.1.1 (2024-11-26) --------------------- diff --git a/front-end/src/app/services/auth.service.ts b/front-end/src/app/services/auth.service.ts index 10626bb..c883b9a 100644 --- a/front-end/src/app/services/auth.service.ts +++ b/front-end/src/app/services/auth.service.ts @@ -28,11 +28,15 @@ export class AuthService { } getAccount() { - return this.httpClient.get(`${this.apiUrl}accounts/me/`, httpOptions); + return this.httpClient.get(`${this.apiUrl}/api/accounts/me/`, httpOptions); } login(account: { email: string; password: string }) { - return this.httpClient.post(`${this.apiUrl}token/`, account, httpOptions); + return this.httpClient.post( + `${this.apiUrl}/api/token/`, + account, + httpOptions, + ); } logout() { @@ -49,19 +53,22 @@ export class AuthService { password: string; }) { return this.httpClient.post( - `${this.apiUrl}accounts/sign-up/`, + `${this.apiUrl}/api/accounts/sign-up/`, account, httpOptions, ); } deleteAccount() { - return this.httpClient.delete(`${this.apiUrl}accounts/me/`, httpOptions); + return this.httpClient.delete( + `${this.apiUrl}/api/accounts/me/`, + httpOptions, + ); } changePassword(password: string) { return this.httpClient.patch( - `${this.apiUrl}accounts/me/`, + `${this.apiUrl}/api/accounts/me/`, { password }, httpOptions, ); @@ -71,7 +78,7 @@ export class AuthService { refreshToken(refreshRoken: string) { return this.httpClient.post( - `${this.apiUrl}token/refresh/`, + `${this.apiUrl}/api/token/refresh/`, { refresh: refreshRoken, }, diff --git a/front-end/src/app/services/observations.service.ts b/front-end/src/app/services/observations.service.ts index 34278fb..aa73f83 100644 --- a/front-end/src/app/services/observations.service.ts +++ b/front-end/src/app/services/observations.service.ts @@ -23,7 +23,7 @@ export class ObservationsService { startDate?: string, endDate?: string, ) { - let url = `${this.apiUrl}observations/`; + let url = `${this.apiUrl}/api/observations/`; if (observationTypesId) { for (let index = 0; index < observationTypesId.length; index++) { const observationTypeId = observationTypesId[index]; @@ -42,21 +42,21 @@ export class ObservationsService { getObservation(observationId: string) { return this.httpClient.get( - `${this.apiUrl}observations/${observationId}/`, + `${this.apiUrl}/api/observations/${observationId}/`, httpOptions, ); } getMyObservations() { return this.httpClient.get( - `${this.apiUrl}accounts/me/observations/`, + `${this.apiUrl}/api/accounts/me/observations/`, httpOptions, ); } postObservation(observation: ObservationFeature) { return this.httpClient.post( - `${this.apiUrl}accounts/me/observations/`, + `${this.apiUrl}/api/accounts/me/observations/`, { ...observation }, httpOptions, ); @@ -64,7 +64,7 @@ export class ObservationsService { putObservation(observationUuid: string, observation: ObservationFeature) { return this.httpClient.put( - `${this.apiUrl}accounts/me/observations/${observationUuid}/`, + `${this.apiUrl}/api/accounts/me/observations/${observationUuid}/`, { ...observation }, httpOptions, ); @@ -72,7 +72,7 @@ export class ObservationsService { deleteObservation(observationUuid: string) { return this.httpClient.delete( - `${this.apiUrl}accounts/me/observations/${observationUuid}/`, + `${this.apiUrl}/api/accounts/me/observations/${observationUuid}/`, httpOptions, ); } @@ -82,14 +82,14 @@ export class ObservationsService { formData.append('media_file', file); formData.append('media_type', 'image'); return this.httpClient.post( - `${this.apiUrl}accounts/me/observations/${observationId}/medias/`, + `${this.apiUrl}/api/accounts/me/observations/${observationId}/medias/`, formData, ); } deletePhotoObservation(observationUuid: string, photoId: string) { return this.httpClient.delete( - `${this.apiUrl}accounts/me/observations/${observationUuid}/medias/${photoId}/`, + `${this.apiUrl}/api/accounts/me/observations/${observationUuid}/medias/${photoId}/`, httpOptions, ); } diff --git a/front-end/src/app/services/settings.service.ts b/front-end/src/app/services/settings.service.ts index de016bb..a45ae73 100644 --- a/front-end/src/app/services/settings.service.ts +++ b/front-end/src/app/services/settings.service.ts @@ -40,7 +40,7 @@ export class SettingsService { } getSettings() { - return this.httpClient.get(`${this.apiUrl}settings/`, httpOptions); + return this.httpClient.get(`${this.apiUrl}/api/settings/`, httpOptions); } async setSettings(settings: Settings) {