Skip to content
Snippets Groups Projects
Commit 38cd6085 authored by Isaac Evavold's avatar Isaac Evavold
Browse files

pass honors choice to backend

parent 79c5df99
No related branches found
No related tags found
No related merge requests found
......@@ -114,6 +114,7 @@ export class DARSViewComponent implements OnInit, OnDestroy {
darsDegreeProgramCode: event.darsDegreeProgramCode,
degreePlannerPlanName: event.degreePlannerPlanName,
whichEnrolledCoursesIncluded: event.whichEnrolledCoursesIncluded,
darsHonorsOptionCode: event.darsHonorsOptionCode,
}),
);
}
......@@ -136,6 +137,7 @@ export class DARSViewComponent implements OnInit, OnDestroy {
darsDegreeProgramCode: event.darsDegreeProgramCode,
degreePlannerPlanName: event.degreePlannerPlanName,
whichEnrolledCoursesIncluded: event.whichEnrolledCoursesIncluded,
darsHonorsOptionCode: event.darsHonorsOptionCode,
}),
);
}
......
......@@ -71,21 +71,17 @@ export class DarsApiService {
/**
* Request a new audit
*/
public newAudit(
darsInstitutionCode: string,
darsDegreeProgramCode: string,
degreePlannerPlanName?: string,
whichEnrolledCoursesIncluded?: string,
): Observable<{ darsJobId: string }> {
public newAudit(params: {
darsInstitutionCode: string;
darsDegreeProgramCode: string;
degreePlannerPlanName?: string;
whichEnrolledCoursesIncluded?: string;
darsHonorsOptionCode: string;
}): Observable<{ darsJobId: string }> {
const url = `${environment.apiDarsUrl}/auditrequest`;
return this.http.post<{ darsJobId: string }>(
url,
{
darsInstitutionCode,
darsDegreeProgramCode,
degreePlannerPlanName,
whichEnrolledCoursesIncluded,
},
{ ...params },
HTTP_OPTIONS,
);
}
......
......@@ -86,6 +86,7 @@ export class StartSendingAudit implements Action {
auditType: 'program' | 'whatIf';
darsInstitutionCode: string;
darsDegreeProgramCode: string;
darsHonorsOptionCode: string;
degreePlannerPlanName?: string;
whichEnrolledCoursesIncluded?: string;
},
......
......@@ -133,27 +133,20 @@ export class DARSEffects {
ofType(DarsActionTypes.StartSendingAudit),
flatMap((action: darsActions.StartSendingAudit) => {
const auditType = action.payload.auditType;
return this.api
.newAudit(
action.payload.darsInstitutionCode,
action.payload.darsDegreeProgramCode,
action.payload.degreePlannerPlanName,
action.payload.whichEnrolledCoursesIncluded,
)
.pipe(
map(({ darsJobId }) => {
return new darsActions.DoneSendingAudit({ auditType, darsJobId });
}),
catchError(_err => {
this.snackBar.open('Unable to generate audit');
return of(
new darsActions.ErrorSendingAudit({
auditType,
message: 'Unable to generate audit',
}),
);
}),
);
return this.api.newAudit({ ...action.payload }).pipe(
map(({ darsJobId }) => {
return new darsActions.DoneSendingAudit({ auditType, darsJobId });
}),
catchError(_err => {
this.snackBar.open('Unable to generate audit');
return of(
new darsActions.ErrorSendingAudit({
auditType,
message: 'Unable to generate audit',
}),
);
}),
);
}),
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment