-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from Aar-if/main
Issue #PS-1802 feat: Create Course Planner API integration in Admin app
- Loading branch information
Showing
5 changed files
with
83 additions
and
52 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { CoursePlannerMetaData } from "@/utils/Interfaces"; | ||
import { post } from "./RestClient"; | ||
|
||
|
||
export const uploadCoursePlanner = async (file: File, metaData: CoursePlannerMetaData): Promise<any> => { | ||
const apiUrl: string = `${process.env.NEXT_PUBLIC_TELEMETRY_URL}/user/v1/course-planner/upload`; | ||
const formData = new FormData(); | ||
formData.append('file', file); | ||
formData.append('metaData', JSON.stringify(metaData)); | ||
try { | ||
const response = await post(apiUrl, formData, { | ||
}); | ||
return response?.data; | ||
} catch (error) { | ||
console.error('Error uploading course planner', error); | ||
throw error; | ||
} | ||
}; | ||
|
||
|
||
|
||
|
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