Fix for javascript optional parameter formatting error

This commit is contained in:
Imbus 2024-04-03 18:05:56 +02:00
parent f9c30c4951
commit 76ae587116

View file

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