File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Request , Response } from "express" ;
22import * as memberService from "../services/member.service" ;
33import { ApiError } from "../utils/apiError" ;
4- import { deleteImage , uploadImage } from "../utils/imageUtils" ;
4+ import { uploadImage } from "../utils/imageUtils" ;
55import { SupabaseClient } from "@supabase/supabase-js" ;
66
77// List all approved members
88export const listAllApprovedMembers = async ( req : Request , res : Response ) => {
99
10- const { email, password } = req . query ;
10+ const { email} = req . query ;
1111
12- if ( email && password ) {
12+ if ( email ) {
1313
1414 const user = await memberService . getUserByEmail ( email as string ) ;
1515
@@ -58,10 +58,10 @@ export const createAMember =
5858 const user = await memberService . createMember (
5959 email ,
6060 name ,
61+ provider ,
6162 password ,
6263 passoutYear ,
6364 imageUrl ,
64- provider ,
6565 ) ;
6666
6767 if ( ! user ) throw new ApiError ( "Error creating user" , 500 ) ;
Original file line number Diff line number Diff line change 11import express from 'express' ;
22import * as acheivementsCtrl from '../controllers/achievement.controller' ;
3- import { supabase } from '../app' ;
43import { Multer } from 'multer' ;
54import { SupabaseClient } from '@supabase/supabase-js' ;
65
Original file line number Diff line number Diff line change 11import express from "express" ;
22import * as memberCtrl from "../controllers/member.controller" ;
33import { Multer } from "multer" ;
4- import { supabase } from "../app" ;
54import { SupabaseClient } from "@supabase/supabase-js" ;
65
76export default function membersRouter (
Original file line number Diff line number Diff line change @@ -15,8 +15,17 @@ export default function progressRouter() {
1515 * @apiParam {String} memberId ID of the member to retrieve completed questions for.
1616 *
1717 * @apiSuccess {String="SUCCESS"} status Response status.
18- * @apiSuccess {Object[]} completedQuestion List of completed questions.
19- * @apiSuccess {Number} completedQuestion.questionId Id of the completed question.
18+ * @apiSuccess {Object[]} completedQuestion List of questions inside the topic.
19+ * @apiSuccess {Object} completedQuestion[].question Question object.
20+ * @apiSuccess {Number} completedQuestion[].question.id Question ID.
21+ * @apiSuccess {String} completedQuestion[].question.questionName Name of the question.
22+ * @apiSuccess {String} completedQuestion[].question.link Link to the question.
23+ * @apiSuccess {String="Easy","Medium","Hard"} completedQuestion[].question.difficulty Difficulty level of the question.
24+ * @apiSuccess {Number} completedQuestion[].question.topicId Topic ID associated with the question.
25+ * @apiSuccess {Number} completedQuestion[].question.createdAt Timestamp when the question was created (Unix timestamp).
26+ * @apiSuccess {Number} completedQuestion[].question.updatedAt Timestamp when the question was last updated (Unix timestamp).
27+ * @apiSuccess {String} completedQuestion[].question.createdById ID of the user who created the question.
28+ * @apiSuccess {String} completedQuestion[].question.updatedById ID of the user who last updated the question.
2029 *
2130 * @apiError (Error 400) BadRequest Missing required fields.
2231 * @apiError (Error 500) InternalServerError Error while fetching completed questions.
Original file line number Diff line number Diff line change @@ -11,9 +11,6 @@ export const getUserByEmail = async(email: string) => {
1111 isApproved : true ,
1212 isManager : true ,
1313 accounts : {
14- where : {
15- provider : 'credentials' ,
16- } ,
1714 select : {
1815 password : true
1916 }
@@ -42,9 +39,9 @@ export const createMember = async (
4239 email : string ,
4340 name : string ,
4441 provider : "google" | "github" | "credentials" ,
42+ password ?: string ,
4543 passoutYear ?: number ,
4644 imageUrl ?: string ,
47- password ?: string
4845) => {
4946 const newMember = await prisma . member . create ( {
5047 data : {
You can’t perform that action at this time.
0 commit comments