Browse Source

Refactoring

pull/5065/head
Thomas Kaul 19 hours ago
parent
commit
3d2986483c
  1. 1
      apps/api/src/services/property/interfaces/interfaces.ts
  2. 6
      apps/api/src/services/property/property.service.ts

1
apps/api/src/services/property/interfaces/interfaces.ts

@ -0,0 +1 @@
export type PropertyValue = boolean | object | string | string[];

6
apps/api/src/services/property/property.service.ts

@ -6,7 +6,7 @@ import {
import { Injectable } from '@nestjs/common';
type Value = boolean | object | string | string[];
import { PropertyValue } from './interfaces/interfaces';
@Injectable()
export class PropertyService {
@ -20,7 +20,7 @@ export class PropertyService {
public async get() {
const response: {
[key: string]: Value;
[key: string]: PropertyValue;
} = {
[PROPERTY_CURRENCIES]: []
};
@ -40,7 +40,7 @@ export class PropertyService {
return response;
}
public async getByKey<TValue extends Value>(aKey: string) {
public async getByKey<TValue extends PropertyValue>(aKey: string) {
const properties = await this.get();
return properties[aKey] as TValue;
}

Loading…
Cancel
Save