Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Siga as etapas abaixo para configurar e executar a API Tasks localmente:
**Clone o Repositório:**

```bash
git clone https://github.com/TiagoM13/backend_todolist.git
git clone https://github.com/TiagoM13/api-tasks.git
cd api-tasks
```
**Instale as Dependências:**
Expand Down Expand Up @@ -72,13 +72,13 @@ O servidor será iniciado em http://localhost:3333 por padrão, .
# ou
yarn build
```
**Executar Testes:**
<!-- **Executar Testes:**

```bash
npm test
# ou
yarn test
```
``` -->

## Estrutura JSON de uma Tarefa 📊

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "backend_todolist",
"name": "api-tasks",
"version": "0.1.0",
"description": "gerenciador de tarefas (Tasks Organized)",
"main": "index.js",
Expand Down
4 changes: 4 additions & 0 deletions src/app/enum/task.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum StatusTask {
PENDING = 'pending',
COMPLETED = 'completed',
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { StatusTask } from "@app/enum/task";
import { AppError } from "@app/errors/AppError";
import { TaskRepository } from "@repositories/tasks/TaskRepository";

Expand All @@ -19,7 +20,7 @@ class UpdatedTaskService {
throw new AppError('The "title" field must contain at least 2 characters.')
}

if (task.status === 'completed') {
if (task.status === StatusTask.COMPLETED) {
throw new AppError('Unable to update a completed task.', 400);
}

Expand Down