Skip to content

Commit

Permalink
🥭 checks added
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeManSu committed Jul 12, 2024
1 parent 172c5fa commit 775857e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/sprintController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const createSprint = async (req: Request, res: Response, next: NextFuncti

res.status(201).json({
success: true,
message: "New sprint created",
message: "New Sprint created",
sprint: newSprint,
});

Expand Down
4 changes: 4 additions & 0 deletions src/services/sprintService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class SprintService {
async createSprint(sprintData: SprintBodyInput): Promise<Sprint> {
const { name, description, start_date, end_date, status } = sprintData;

if (!name.trim()) {
throw new ErrorHandlerClass("Sprint name is required", 400);
}

const organization = await sprintRepository.findOrganization();

if (!organization) {
Expand Down

0 comments on commit 775857e

Please sign in to comment.