Skip to content

Commit c35b634

Browse files
committed
✨ Add mvn:// prefix to application binary value in post request
Signed-off-by: Ian Bolton <[email protected]>
1 parent 0cce0d8 commit c35b634

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

client/src/app/pages/applications/components/application-form/application-form.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,13 @@ export const useApplicationFormHook = ({
258258
});
259259

260260
const onValidSubmit = (formValues: FormValues) => {
261+
let binaryValue = formValues.packaging
262+
? `${formValues.group}:${formValues.artifact}:${formValues.version}:${formValues.packaging}`
263+
: `${formValues.group}:${formValues.artifact}:${formValues.version}`;
264+
if (!binaryValue.startsWith("mvn://")) {
265+
binaryValue = `mvn://${binaryValue}`;
266+
}
267+
261268
const payload: New<Application> = {
262269
name: formValues.name.trim(),
263270
description: formValues.description.trim(),
@@ -282,10 +289,7 @@ export const useApplicationFormHook = ({
282289
path: formValues.rootPath.trim(),
283290
}
284291
: undefined,
285-
286-
binary: formValues.packaging
287-
? `${formValues.group}:${formValues.artifact}:${formValues.version}:${formValues.packaging}`
288-
: `${formValues.group}:${formValues.artifact}:${formValues.version}`,
292+
binary: binaryValue,
289293

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

0 commit comments

Comments
 (0)