Fix for javascript optional parameter formatting error

This commit is contained in:
Imbus 2024-04-03 18:05:56 +02:00 committed by Peter KW
parent ee49bbde69
commit 10d06767c4

View file

@ -540,7 +540,7 @@ export const api: API = {
): Promise<APIResponse<WeeklyReport>> {
try {
const response = await fetch(
`/api/getWeeklyReport?projectName=${projectName}&week=${week}&targetUser=${targetUser}`,
`/api/getWeeklyReport?projectName=${projectName}&week=${week}&targetUser=${targetUser ?? ""}`,
{
method: "GET",
headers: {
@ -568,7 +568,7 @@ export const api: API = {
): Promise<APIResponse<WeeklyReport[]>> {
try {
const response = await fetch(
`/api/getAllWeeklyReports/${projectName}?targetUser=${targetUser}`,
`/api/getAllWeeklyReports/${projectName}?targetUser=${targetUser ?? ""}`,
{
method: "GET",
headers: {