File size: 577 Bytes
7b850b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae1ae66
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { en } from 'src/locales/en';
import { I18nResolver } from 'i18n-ts';
import { Inject, Injectable } from '@nestjs/common';
import * as constants from '../../constants'

const i18n = {
  en: en,
  default: en,
};

@Injectable()
export class CommonServices{
  public messages = new I18nResolver(i18n, 'en').translation;
  public constants = constants;
  constructor() {
  }

  /**

   * name

   */
  public sendResponse = (mesage, data, status, res) => {
    return res.status(status).json({
      message: mesage,
      data: data,
    });
  };
}