Skip to content

Commit

Permalink
add create task in the controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaalanMarwan committed Apr 28, 2022
1 parent 664550f commit 0399e6d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tasks/tasks.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Controller, Get, Post } from '@nestjs/common';
import { Body, Controller, Get, Post } from '@nestjs/common';
import { Task } from 'src/tasks/task.model';
import { TasksService } from 'src/tasks/tasks.service';

Expand All @@ -10,4 +10,12 @@ export class TasksController {
getTasks(): Task[] {
return this.tasksService.getTasks();
}

@Post()
createTask(
@Body('title') title: string,
@Body('description') description: string,
) {
return this.tasksService.createTask(title, description);
}
}

0 comments on commit 0399e6d

Please sign in to comment.