-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
379 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { | ||
updateProfileService, | ||
changePasswordService, | ||
} from "../services/instructor"; | ||
import { PasswordInfo } from "../types/student/student"; | ||
import END_POINTS from "../../constants/endpoints"; | ||
|
||
export const changePassword = (passwordInfo: PasswordInfo) => { | ||
return changePasswordService( | ||
END_POINTS.INSTRUCTOR_CHANGE_PASSWORD, | ||
passwordInfo | ||
); | ||
}; | ||
|
||
export const updateProfile = (profileInfo: FormData) => { | ||
return updateProfileService( | ||
END_POINTS.INSTRUCTOR_UPDATE_PROFILE, | ||
profileInfo | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import CONSTANTS_COMMON from "../../constants/common"; | ||
import api from "../middlewares/protectedInterceptor"; | ||
import { PasswordInfo} from "../types/student/student"; | ||
|
||
export const changePasswordService = async ( | ||
endpoint: string, | ||
passwordInfo: PasswordInfo | ||
) => { | ||
const response = await api.patch( | ||
`${CONSTANTS_COMMON.API_BASE_URL}/${endpoint}`, | ||
passwordInfo | ||
); | ||
return response; | ||
}; | ||
|
||
export const updateProfileService = async ( | ||
endpoint: string, | ||
profileInfo: FormData | ||
) => { | ||
const response = await api.put( | ||
`${CONSTANTS_COMMON.API_BASE_URL}/${endpoint}`, | ||
profileInfo | ||
); | ||
return response; | ||
}; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export interface PasswordInfo { | ||
currentPassword: string; | ||
newPassword: string; | ||
} | ||
export interface UpdateProfileInfo { | ||
firstName?: string; | ||
lastName?: string; | ||
email?: string; | ||
mobile?: string; | ||
profilePic?: File | null; | ||
qualification?:string; | ||
subjects?:string; | ||
experience?:string; | ||
skills?:string; | ||
about?:string; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.