Skip to content

Commit 3b637eb

Browse files
feat: added get_hostel_details() to fetch hostel data (#8)
1 parent 52894a3 commit 3b637eb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/wrapper.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,22 @@ export class WebPortal {
507507
const resp = await this.__hit("POST", API + ENDPOINT, { json: payload, authenticated: true });
508508
return resp["response"];
509509
}
510+
async get_hostel_details() {
511+
const ENDPOINT = "/myhostelallocationdetail/gethostelallocationdetail";
512+
const payload = {
513+
clientid: this.session.clientid,
514+
instituteid: this.session.instituteid,
515+
studentid: this.session.memberid,
516+
};
517+
518+
const resp = await this.__hit("POST", API + ENDPOINT, { json: payload, authenticated: true });
519+
520+
if (!resp?.response) {
521+
throw new Error("Hostel details not found");
522+
}
523+
524+
return resp.response;
525+
}
510526

511527
async fill_feedback_form(feedback_option) {
512528
const SEMESTER_ENDPOINT = "/feedbackformcontroller/getFeedbackEvent";
@@ -642,6 +658,7 @@ const authenticatedMethods = [
642658
"get_grade_card",
643659
"__get_semester_number",
644660
"get_sgpa_cgpa",
661+
"get_hostel_details", // NEWLY ADDED
645662
];
646663

647664
authenticatedMethods.forEach((methodName) => {

0 commit comments

Comments
 (0)