mirror of
https://gitlab.com/mobicoop/v3/service/territory.git
synced 2026-03-28 01:25:51 +00:00
improve tests
This commit is contained in:
@@ -104,7 +104,7 @@ export class TerritoriesController {
|
||||
return this._mapper.map(territory, Territory, TerritoryPresenter);
|
||||
} catch (e) {
|
||||
if (e instanceof DatabaseException) {
|
||||
if (e.message.includes('Already exists')) {
|
||||
if (e.message.includes('already exists')) {
|
||||
throw new RpcException({
|
||||
code: 6,
|
||||
message: 'Territory already exists',
|
||||
|
||||
@@ -34,7 +34,7 @@ export class CreateTerritoryUseCase {
|
||||
return territory;
|
||||
} catch (error) {
|
||||
let key = 'territory.create.crit';
|
||||
if (error.message.includes('Already exists')) {
|
||||
if (error.message.includes('already exists')) {
|
||||
key = 'territory.create.warning';
|
||||
}
|
||||
this._loggingMessager.publish(
|
||||
|
||||
Reference in New Issue
Block a user