Skip to content

Commit

Permalink
fix : status 반환 잘못된거 수정
Browse files Browse the repository at this point in the history
insert 부분에서 status 가 잘 못 반환되는 문제를 수정했습니다.
#72
  • Loading branch information
gitdog01 committed Nov 6, 2020
1 parent fc5ffe6 commit 0328aef
Show file tree
Hide file tree
Showing 8 changed files with 313 additions and 315 deletions.
616 changes: 308 additions & 308 deletions BE/package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion BE/src/controllers/milestone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const add = async (req: Request, res: Response): Promise<Response> => {
name: req.body.name,
description: req.body.description,
due_date: req.body.due_date,
state: true,
created_at: new Date(),
};
const result = await MilestoneModel.add(milestone);
Expand Down
1 change: 0 additions & 1 deletion BE/src/interfaces/milestone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export interface Milestone {
name: string;
description: string;
due_date: Date | null;
state: boolean;
created_at: Date;
}
2 changes: 1 addition & 1 deletion BE/src/models/assignee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AssigneeModel extends Model {
async add(pData: Assignee): Promise<number> {
try {
this.data = await super.insert(pData, this.tableName);
return this.data ? this.data : HTTPCODE.FAIL;
return this.data ? HTTPCODE.SUCCESS : HTTPCODE.FAIL;
} catch {
return HTTPCODE.SERVER_ERR;
}
Expand Down
2 changes: 1 addition & 1 deletion BE/src/models/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CommentModel extends Model {
async add(pData: Comment): Promise<any> {
try {
this.data = await super.insert(pData, this.tableName);
return this.data ? this.data : HTTPCODE.FAIL;
return this.data ? HTTPCODE.SUCCESS : HTTPCODE.FAIL;
} catch {
return HTTPCODE.SERVER_ERR;
}
Expand Down
2 changes: 1 addition & 1 deletion BE/src/models/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class EventModel extends Model {
async add(pData: Event): Promise<number> {
try {
this.data = await super.insert(pData, this.tableName);
return this.data ? this.data : HTTPCODE.FAIL;
return this.data ? HTTPCODE.SUCCESS : HTTPCODE.FAIL;
} catch {
return HTTPCODE.SERVER_ERR;
}
Expand Down
2 changes: 1 addition & 1 deletion BE/src/models/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class IssueModel extends Model {
async add(pData: Issue): Promise<number> {
try {
this.data = await super.insert(pData, this.tableName);
return this.data ? this.data : HTTPCODE.FAIL;
return this.data ? HTTPCODE.SUCCESS : HTTPCODE.FAIL;
} catch {
return HTTPCODE.SERVER_ERR;
}
Expand Down
2 changes: 1 addition & 1 deletion BE/src/models/label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LabelModel extends Model {
async add(pData: Label): Promise<number> {
try {
this.data = await super.insert<Label>(pData, `${this.tableName}`);
return this.data ? this.data : HTTPCODE.FAIL;
return this.data ? HTTPCODE.SUCCESS : HTTPCODE.FAIL;
} catch {
return HTTPCODE.SERVER_ERR;
}
Expand Down

0 comments on commit 0328aef

Please sign in to comment.