Skip to content

Instantly share code, notes, and snippets.

@job25721
Created January 21, 2022 08:52
Show Gist options
  • Save job25721/2912d050b6db650b8cb77d8790ec65d0 to your computer and use it in GitHub Desktop.
Save job25721/2912d050b6db650b8cb77d8790ec65d0 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