Skip to content

Commit

Permalink
READY TO SIGN in ConventionForm
Browse files Browse the repository at this point in the history
  • Loading branch information
enguerranws committed Jun 5, 2023
1 parent 1196af9 commit 054a28a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion front/src/app/components/forms/convention/ConventionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ export const ConventionForm = ({
if (!fetchedConvention) return;
// TODO : show feedback if convention is null
dispatch(
conventionSlice.actions.saveConventionRequested(fetchedConvention),
conventionSlice.actions.saveConventionRequested({
...fetchedConvention,
status: "READY_TO_SIGN",
}),
);
};
const onSubmit: SubmitHandler<ConventionReadDto> = (values) => {
Expand Down
1 change: 0 additions & 1 deletion front/src/core-logic/domain/convention/convention.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export const conventionSlice = createSlice({
action: PayloadAction<ConventionReadDto>,
) => {
state.isLoading = true;
action.payload.status = "READY_TO_SIGN";
state.convention = action.payload;
},
saveConventionSucceeded: (state) => {
Expand Down
4 changes: 3 additions & 1 deletion front/src/core-logic/domain/convention/convention.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ describe("Convention slice", () => {

describe("Save convention", () => {
it("saves a new convention", () => {
const convention = new ConventionDtoBuilder().withStatus("DRAFT").build();
const convention = new ConventionDtoBuilder()
.withStatus("READY_TO_SIGN")
.build();
store.dispatch(
conventionSlice.actions.saveConventionRequested({
...convention,
Expand Down

0 comments on commit 054a28a

Please sign in to comment.