Skip to content

Instantly share code, notes, and snippets.

@job25721
Created January 21, 2022 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save job25721/8afa5d636babd48d79fac98d60c7bbfb to your computer and use it in GitHub Desktop.
Save job25721/8afa5d636babd48d79fac98d60c7bbfb to your computer and use it in GitHub Desktop.
import { Injectable } from '@nestjs/common';
import { JsonPlaceholderService } from 'src/services/jsonPlacehodlerService';
import { User } from './user.schema';
@Injectable()
export class UserSerivce {
constructor(
private readonly jsonPlaceholderService: JsonPlaceholderService,
) {}
helloWorld(): string {
return 'hello world';
}
async getUsers(): Promise<User[]> {
const response = await this.jsonPlaceholderService.getUsers();
return response.data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment