Skip to content

OBPIH-6170 Add an endpoint to delete a product supplier preference#4531

Merged
awalkowiak merged 2 commits intofeature/product-supplier-list-redesignfrom
OBPIH-6170
Mar 5, 2024
Merged

OBPIH-6170 Add an endpoint to delete a product supplier preference#4531
awalkowiak merged 2 commits intofeature/product-supplier-list-redesignfrom
OBPIH-6170

Conversation

@kchelstowski
Copy link
Collaborator

No description provided.

Comment on lines +66 to +73
preferenceType: defaultPreferenceType?.preferenceType ? {
id: defaultPreferenceType.preferenceType.id,
label: defaultPreferenceType.preferenceType.name,
value: defaultPreferenceType.preferenceType.id,
} : undefined,
validityStartDate: defaultPreferenceType?.validityStartDate ?? undefined,
validityEndDate: defaultPreferenceType?.validityEndDate ?? undefined,
bidName: defaultPreferenceType?.bidName ?? undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better to store all those values under the same key - it will allow us to clear/reset those values simultaneously.

I mean adding:
(here, in the default values)

      defaultPreferenceType: {
        ...defaultPreferenceType,
        preferenceType: {
          id: defaultPreferenceType?.preferenceType?.id,
          label: defaultPreferenceType?.preferenceType?.name,
          value: defaultPreferenceType?.preferenceType?.id,
        },
      },

and then in DefaultPreferenceType.jsx for each controller prepend: defaultPreferenceType

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do such adjustments in the "handle save action" ticket. For now I've just adjusted it to the current logic for the substitution to work as Katarzyna asked me to do.
Additionally - to the backend, it will still have to be sent via productSupplierPreferences array - in onSubmit we will have to append the default there in order for the backend to work. We will distinguish on the backend then, via destinationParty whether it is the default or not.

@awalkowiak awalkowiak merged commit d116faf into feature/product-supplier-list-redesign Mar 5, 2024
@awalkowiak awalkowiak deleted the OBPIH-6170 branch March 5, 2024 12:58
awalkowiak pushed a commit that referenced this pull request Mar 12, 2024
…4531)

* OBPIH-6170 Substitute default preference type when editing a product supplier

* OBPIH-6170 Add an endpoint to delete a product supplier preference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants