Created
July 6, 2020 20:05
-
-
Save nmchenry01/33a2bcdf258f36bfbd7bea24c8ddb1af to your computer and use it in GitHub Desktop.
Task Service for "Why you should use NestJS for your next project" Blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@nestjs/common'; | |
import { Task } from './models/task.entity'; | |
@Injectable() | |
export class TaskService { | |
private readonly tasks: Task[] = []; | |
createTask(task: Task): void { | |
this.tasks.push(task); | |
} | |
findAllTasks(): Task[] { | |
return this.tasks; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment