-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove task form plan requests
- Loading branch information
1 parent
764a6be
commit e3d2dd1
Showing
4 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ICreateDailyPlan, INextParams } from '@app/interfaces'; | ||
import { authenticatedGuard } from '@app/services/server/guards/authenticated-guard-app'; | ||
import { removeTaskFromPlanRequest } from '@app/services/server/requests'; | ||
import { NextResponse } from 'next/server'; | ||
|
||
export async function PUT(req: Request, { params }: INextParams) { | ||
const res = new NextResponse(); | ||
|
||
const { planId } = params; | ||
if (!planId) { | ||
return; | ||
} | ||
|
||
const { $res, user, tenantId, organizationId, access_token } = await authenticatedGuard(req, res); | ||
if (!user) return $res('Unauthorized'); | ||
|
||
const body = (await req.json()) as unknown as Partial<ICreateDailyPlan>; | ||
|
||
const response = await removeTaskFromPlanRequest({ | ||
data: body, | ||
organizationId, | ||
planId, | ||
tenantId, | ||
bearer_token: access_token | ||
}); | ||
|
||
return $res(response.data); | ||
} |
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
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
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