Skip to content

Commit

Permalink
✨ Add mvn:// prefix to application binary value in post request
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Jun 19, 2024
1 parent 0cce0d8 commit 2cdb6a1
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ export const useApplicationFormHook = ({
});

const onValidSubmit = (formValues: FormValues) => {
let binaryValue = formValues.packaging
? `${formValues.group}:${formValues.artifact}:${formValues.version}:${formValues.packaging}`
: `${formValues.group}:${formValues.artifact}:${formValues.version}`;
if (!binaryValue.startsWith("mvn://")) {
binaryValue = `mvn://${binaryValue}`;
}

const payload: New<Application> = {
name: formValues.name.trim(),
description: formValues.description.trim(),
Expand All @@ -282,10 +289,7 @@ export const useApplicationFormHook = ({
path: formValues.rootPath.trim(),
}
: undefined,

binary: formValues.packaging
? `${formValues.group}:${formValues.artifact}:${formValues.version}:${formValues.packaging}`
: `${formValues.group}:${formValues.artifact}:${formValues.version}`,
binary: binaryValue,

// Values not editable on the form but still need to be passed through
identities: application?.identities ?? undefined,
Expand Down

0 comments on commit 2cdb6a1

Please sign in to comment.