Skip to content

Commit

Permalink
fix errors in contest.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCai-QwQ committed Oct 13, 2024
1 parent 40aabc1 commit ce6824b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/hasura/contest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1271,9 +1271,9 @@ export const update_room_created_at: any = async (room_id: string, created_at: s
* @param {Date} end_date The new end date of the contest (timestamp).
* @returns {string} The ID of the updated contest.
*/
export const update_contest_info:any = async(contest_id: string, ...updateFields:Partial<{fullname: string; description: string; start_date: Date;end_date: Date}>) => {
export const update_contest_info:any = async(contest_id: string, updateFields:Partial<{fullname: string; description: string; start_date: Date;end_date: Date}>) => {

let setFields:any = {};
const setFields:any = {};
if (updateFields.fullname) setFields.fullname = updateFields.fullname;
if (updateFields.description) setFields.description = updateFields.description;
if (updateFields.start_date) setFields.start_date = updateFields.start_date;
Expand Down Expand Up @@ -1372,7 +1372,7 @@ export const update_contest_switch:any = async(contest_id: string, team_switch:
* @returns {string} The ID of the updated map.
*/
export const update_contest_map:any = async(map_id:string, updateFields: Partial<{ name: string; filename: string; team_labels: string }>) => {
let setFields: any = {};
const setFields: any = {};
if(updateFields.name) setFields.name = updateFields.name;
if(updateFields.filename) setFields.filename = updateFields.filename;
if(updateFields.team_labels) setFields.team_labels = updateFields.team_labels;
Expand Down Expand Up @@ -1417,7 +1417,7 @@ export const update_contest_map:any = async(map_id:string, updateFields: Partial
* @returns {string} The ID of the updated notice.
*/
export const update_contest_notice: any = async (id: string, updateFields: Partial<{ title: string; content: string; files: string }>) => {
let setFields: any = {};
const setFields: any = {};
if (updateFields.title) setFields.title = updateFields.title;
if (updateFields.content) setFields.content = updateFields.content;
if (updateFields.files) setFields.files = updateFields.files;
Expand Down Expand Up @@ -1462,7 +1462,7 @@ export const update_contest_notice: any = async (id: string, updateFields: Parti
* @returns {string} The team label of the updated player.
*/
export const update_contest_player: any = async (contest_id: string, team_label: string, updateFields: Partial<{ player_label: string; roles_available: string }>) => {
let setFields: any = {};
const setFields: any = {};
if (updateFields.player_label) setFields.player_label = updateFields.player_label;
if (updateFields.roles_available) setFields.roles_available = updateFields.roles_available;

Expand Down Expand Up @@ -1596,7 +1596,7 @@ export const update_team_player:any = async(team_id:string,player:string,code_id
*/

export const update_team:any = async(team_id:string,updateFields:Partial<{ team_name: string; team_intro: string}>) =>{
let setFields: any = {};
const setFields: any = {};
if (updateFields.team_name) setFields.team_name = updateFields.team_name;
if (updateFields.team_intro) setFields.team_intro = updateFields.team_intro;

Expand Down

0 comments on commit ce6824b

Please sign in to comment.