Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2150 - TESTING BUG - Unable to search student in the Support user portal (Parent/partner declaration portal) #2159

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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