From 4e9038994f7236a039d3bbadb6d6893fd7fd795a Mon Sep 17 00:00:00 2001 From: JannikStreek Date: Fri, 7 Oct 2022 21:18:55 +0200 Subject: [PATCH] improve route names (#121) --- teammapper-backend/src/map/controllers/maps.controller.ts | 2 +- teammapper-backend/test/app.e2e-spec.ts | 4 ++-- teammapper-frontend/src/app/core/http/http.service.ts | 2 +- .../src/app/core/services/shortcuts/shortcuts.service.ts | 2 +- .../about/components/jumbotron/jumbotron.component.html | 2 +- .../application/components/toolbar/toolbar.component.html | 2 +- .../application/pages/application/application.component.ts | 2 +- teammapper-frontend/src/app/root-routing.module.ts | 6 ++++++ teammapper-frontend/src/proxy.conf.json | 2 +- 9 files changed, 15 insertions(+), 9 deletions(-) diff --git a/teammapper-backend/src/map/controllers/maps.controller.ts b/teammapper-backend/src/map/controllers/maps.controller.ts index 3ab4f4ef..3c10d761 100644 --- a/teammapper-backend/src/map/controllers/maps.controller.ts +++ b/teammapper-backend/src/map/controllers/maps.controller.ts @@ -5,7 +5,7 @@ import { MmpMap } from '../entities/mmpMap.entity'; import { MapsService } from '../services/maps.service'; import { IMmpClientDeleteRequest, IMmpClientMap, IMmpClientMapWithAdminId } from '../types'; -@Controller('maps') +@Controller('api/maps') export default class MapsController { constructor(private mapsService: MapsService) {} diff --git a/teammapper-backend/test/app.e2e-spec.ts b/teammapper-backend/test/app.e2e-spec.ts index 2699354d..5d61e680 100644 --- a/teammapper-backend/test/app.e2e-spec.ts +++ b/teammapper-backend/test/app.e2e-spec.ts @@ -40,7 +40,7 @@ describe('AppController (e2e)', () => { await app.close(); }); - it('/maps/:id(GET)', async () => { + it('/api/maps/:id(GET)', async () => { const map: MmpMap = await mapRepo.save({ name: 'test' }); await nodesRepo.save({ nodeMapId: map.id, @@ -48,7 +48,7 @@ describe('AppController (e2e)', () => { coordinatesY: 1, }); const response: request.Response = await request(server).get( - `/maps/${map.id}`, + `/api/maps/${map.id}`, ); expect(response.body.uuid).toEqual(map.id); }); diff --git a/teammapper-frontend/src/app/core/http/http.service.ts b/teammapper-frontend/src/app/core/http/http.service.ts index 4e7d0d1a..27e8546f 100644 --- a/teammapper-frontend/src/app/core/http/http.service.ts +++ b/teammapper-frontend/src/app/core/http/http.service.ts @@ -5,7 +5,7 @@ import { Injectable } from '@angular/core' */ export enum API_URL { LOCAL_ASSETS = './assets/data/', - ROOT = '' + ROOT = 'api' } @Injectable({ diff --git a/teammapper-frontend/src/app/core/services/shortcuts/shortcuts.service.ts b/teammapper-frontend/src/app/core/services/shortcuts/shortcuts.service.ts index 47a82fa1..6157a3d8 100644 --- a/teammapper-frontend/src/app/core/services/shortcuts/shortcuts.service.ts +++ b/teammapper-frontend/src/app/core/services/shortcuts/shortcuts.service.ts @@ -35,7 +35,7 @@ export class ShortcutsService { description: 'TOOLTIPS.NEW_MAP', callback: () => { // use a full page reload here to reload all singleton services - window.location.replace('/app') + window.location.replace('/map') } }, { keys: 'c', diff --git a/teammapper-frontend/src/app/modules/about/components/jumbotron/jumbotron.component.html b/teammapper-frontend/src/app/modules/about/components/jumbotron/jumbotron.component.html index c0926724..cae788cc 100644 --- a/teammapper-frontend/src/app/modules/about/components/jumbotron/jumbotron.component.html +++ b/teammapper-frontend/src/app/modules/about/components/jumbotron/jumbotron.component.html @@ -27,7 +27,7 @@

{{ "PAGES.ABOUT.INTRODUCTION.APPLICATION_PROPERTIES.3" | translate - + {{ "GENERAL.TRY_IT" | translate }} diff --git a/teammapper-frontend/src/app/modules/application/components/toolbar/toolbar.component.html b/teammapper-frontend/src/app/modules/application/components/toolbar/toolbar.component.html index 743d3bce..dfb057c1 100644 --- a/teammapper-frontend/src/app/modules/application/components/toolbar/toolbar.component.html +++ b/teammapper-frontend/src/app/modules/application/components/toolbar/toolbar.component.html @@ -1,5 +1,5 @@ - +