Skip to content

Commit

Permalink
Merge pull request #1115 from TomChapmanGov/default_nation
Browse files Browse the repository at this point in the history
default nation
  • Loading branch information
TomChapmanGov authored Oct 26, 2023
2 parents 8a1aa7d + ab275d1 commit 481bf55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { yupResolver } from "@hookform/resolvers/yup";
import { ETFormLabel } from "../shared/index";
import { Staff } from "../../models/staff";
import indigenousNationService from "../../services/indigenousNationService/indigenousNationService";
import { FirstNation } from "../../models/firstNation";
import { FirstNation, defaultFirstNation } from "../../models/firstNation";
import staffService from "../../services/staffService/staffService";
import ControlledSelectV2 from "../shared/controlledInputComponents/ControlledSelectV2";
import { MasterContext } from "../shared/MasterContext";
Expand Down Expand Up @@ -73,7 +73,7 @@ export default function IndigenousNationForm({ ...props }) {
} = methods;

React.useEffect(() => {
reset(ctx.item);
reset(ctx.item ?? defaultFirstNation);
if (ctx.item) {
setNotes((ctx.item as FirstNation)?.notes || "");
}
Expand Down
4 changes: 4 additions & 0 deletions epictrack-web/src/models/firstNation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ export interface WorkFirstNation extends ListType, MasterBase {
is_active: boolean;
status: string;
}

export const defaultFirstNation = {
is_active: true,
};

0 comments on commit 481bf55

Please sign in to comment.