Skip to content

Commit

Permalink
fix SchemeLicenseEditor #209
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Feb 28, 2025
1 parent 8573205 commit adeb4ea
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,23 @@ async function save(e: FormSubmitEvent) {
Object.entries(e.states).map(([key, state]) => [key, state.value]),
);
// TODO: in future versions hit an API for expected shape &&
// recursively map the form data to the expected shape
const expectedTileShape = {
right_holder: formData.right_holder,
right_type: formData.right_type,
right_statement: {
right_statement_content: formData.right_statement_content,
right_statement_language: formData.right_statement_language,
right_statement_type: formData.right_statement_type,
right_statement_type_metatype:
formData.right_statement_type_metatype,
},
};
if (!props.resourceInstanceId) {
const updated = await createScheme({
[props.nodegroupAlias]: formData,
[props.nodegroupAlias]: expectedTileShape,
});
await router.push({
Expand All @@ -70,7 +84,7 @@ async function save(e: FormSubmitEvent) {
props.nodegroupAlias,
{
resourceinstance: props.resourceInstanceId,
...formData,
...expectedTileShape,
tileid: props.tileId,
},
props.tileId,
Expand Down

0 comments on commit adeb4ea

Please sign in to comment.