Skip to content

Commit

Permalink
#2150 - TESTING BUG - Unable to search student in the Support user po…
Browse files Browse the repository at this point in the history
…rtal (Parent/partner declaration portal) (#2159)

#2150 - TESTING BUG - Unable to search student in the Support user portal (Parent/partner declaration portal) (#2159)
  • Loading branch information
ann-aot authored Aug 3, 2023
1 parent 9f31199 commit 4ca7902
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
18 changes: 15 additions & 3 deletions sources/packages/web/src/services/http/dto/SupportingUser.dto.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
import { SupportingUserType } from "@/types";
import { ContactInformationAPIOutDTO } from "./Address.dto";
import { Expose } from "class-transformer";

/**
* Information used to uniquely identify a Student Application.
* The application must be search using at least 3 criteria as
* per defined by the Ministry policies.
*/
export interface ApplicationIdentifierAPIInDTO {
export class ApplicationIdentifierAPIInDTO {
@Expose()
applicationNumber: string;
@Expose()
studentsDateOfBirth: string;
@Expose()
studentsLastName: string;
}

/**
* Data send to api to update a supporting user.
*/
export interface UpdateSupportingUserAPIInDTO
extends ApplicationIdentifierAPIInDTO {
export class UpdateSupportingUserAPIInDTO extends ApplicationIdentifierAPIInDTO {
@Expose()
addressLine1: string;
@Expose()
addressLine2?: string;
@Expose()
city: string;
@Expose()
country: string;
@Expose()
phone: string;
@Expose()
postalCode: string;
@Expose()
provinceState?: string;
@Expose()
sin: string;
@Expose()
supportingData: unknown;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ import {
VForm,
ApiProcessError,
} from "@/types";
import { UpdateSupportingUserAPIInDTO } from "@/services/http/dto";
export default defineComponent({
props: {
Expand All @@ -140,7 +141,7 @@ export default defineComponent({
const studentsLastName = ref("");
const studentsDateOfBirth = ref();
const initialData = ref();
const formioUtils = useFormioUtils();
const { disableWizardButtons, excludeExtraneousValues } = useFormioUtils();
const isFirstPage = ref(true);
const isLastPage = ref(false);
const showNav = ref(false);
Expand All @@ -156,7 +157,7 @@ export default defineComponent({
showNav.value = true;
formInstance = form;
// Disable internal submit button.
formioUtils.disableWizardButtons(formInstance);
disableWizardButtons(formInstance);
formInstance.options.buttonSettings.showSubmit = false;
// Handle the navigation using the breadcrumbs.
formInstance.on(
Expand Down Expand Up @@ -197,6 +198,7 @@ export default defineComponent({
});
const applicationSearch = async () => {
showNav.value = false;
const validationResult = await searchApplicationsForm.value.validate();
if (!validationResult.valid) {
return;
Expand Down Expand Up @@ -233,12 +235,16 @@ export default defineComponent({
}
};
const submitted = async (formData: any) => {
const submitted = async (formData: unknown) => {
submitting.value = true;
try {
const typedData = excludeExtraneousValues(
UpdateSupportingUserAPIInDTO,
formData,
);
await SupportingUsersService.shared.updateSupportingInformation(
props.supportingUserType,
{ ...formData, ...getIdentifiedApplication() },
{ ...typedData, ...getIdentifiedApplication() },
);
snackBar.success("Supporting data submitted with success.");
Expand Down

0 comments on commit 4ca7902

Please sign in to comment.