-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
342 additions
and
33 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/// <reference types="cookie-parser" /> | ||
import type { Request, Response } from 'express'; | ||
export default function handler(request: Request, response: Response): Promise<void>; |
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,12 @@ | ||
import getFeeCategories from '../../database/getFeeCategories.js'; | ||
import { updateFeeAmount } from '../../database/updateFee.js'; | ||
export default async function handler(request, response) { | ||
const success = await updateFeeAmount(request.body, request.session.user); | ||
const feeCategories = await getFeeCategories({}, { | ||
includeFees: true | ||
}); | ||
response.json({ | ||
success, | ||
feeCategories | ||
}); | ||
} |
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,29 @@ | ||
import type { Request, Response } from 'express' | ||
|
||
import getFeeCategories from '../../database/getFeeCategories.js' | ||
import { | ||
type UpdateFeeAmountForm, | ||
updateFeeAmount | ||
} from '../../database/updateFee.js' | ||
|
||
export default async function handler( | ||
request: Request, | ||
response: Response | ||
): Promise<void> { | ||
const success = await updateFeeAmount( | ||
request.body as UpdateFeeAmountForm, | ||
request.session.user as User | ||
) | ||
|
||
const feeCategories = await getFeeCategories( | ||
{}, | ||
{ | ||
includeFees: true | ||
} | ||
) | ||
|
||
response.json({ | ||
success, | ||
feeCategories | ||
}) | ||
} |
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
Oops, something went wrong.