Frontend API interface fixed (untested) for getWeeklyReportsForUser
This commit is contained in:
parent
649a4ba1fd
commit
d19372d66b
1 changed files with 9 additions and 2 deletions
|
@ -49,6 +49,14 @@ interface API {
|
||||||
week: string,
|
week: string,
|
||||||
token: string,
|
token: string,
|
||||||
): Promise<APIResponse<WeeklyReport>>;
|
): Promise<APIResponse<WeeklyReport>>;
|
||||||
|
/**
|
||||||
|
* Returns all the weekly reports for a user in a particular project
|
||||||
|
* The username is derived from the token
|
||||||
|
*
|
||||||
|
* @param {string} projectName The name of the project
|
||||||
|
* @param {string} token The token of the user
|
||||||
|
* @returns {APIResponse<WeeklyReport[]>} A list of weekly reports
|
||||||
|
*/
|
||||||
getWeeklyReportsForUser(
|
getWeeklyReportsForUser(
|
||||||
username: string,
|
username: string,
|
||||||
projectName: string,
|
projectName: string,
|
||||||
|
@ -275,12 +283,11 @@ export const api: API = {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getWeeklyReportsForUser(
|
async getWeeklyReportsForUser(
|
||||||
username: string,
|
|
||||||
projectName: string,
|
projectName: string,
|
||||||
token: string,
|
token: string,
|
||||||
): Promise<APIResponse<WeeklyReport[]>> {
|
): Promise<APIResponse<WeeklyReport[]>> {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`, {
|
const response = await fetch(`/api/getWeeklyReportsUser/${projectName}`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
Loading…
Add table
Reference in a new issue