Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
sshoc-marketplace-frontend
Commits
4bc2814b
Commit
4bc2814b
authored
Mar 05, 2021
by
Stefan Probst
Browse files
fix: remove unnesessary fields from payload
parent
72f54499
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/api/sshoc/helpers.ts
View file @
4bc2814b
...
...
@@ -43,8 +43,12 @@ export function convertToInitialFormValues(
|
ToolCore
|
TrainingMaterialCore
|
WorkflowCore
{
return
{
...
item
,
const
initialValues
=
{
label
:
item
.
label
,
version
:
item
.
version
,
description
:
item
.
description
,
accessibleAt
:
item
.
accessibleAt
,
licenses
:
item
.
licenses
,
// deprecated?
/**
* Only ids needed.
*/
...
...
@@ -78,7 +82,7 @@ export function convertToInitialFormValues(
}
}),
/**
*
FIXME: figure out what this is, and why it it incompatible
*
Only ids needed. Also, fields are non-null.
*/
externalIds
:
item
.
externalIds
?.
map
((
id
)
=>
{
return
{
...
...
@@ -92,5 +96,15 @@ export function convertToInitialFormValues(
source
:
{
id
:
item
.
source
?.
id
,
},
sourceItemId
:
item
.
sourceItemId
,
}
if
([
'
dataset
'
,
'
publication
'
].
includes
(
item
.
category
!
))
{
// @ts-expect-error items are not discriminated unions
initialValues
.
dateCreated
=
item
.
dateCreated
// @ts-expect-error items are not discriminated unions
initialValues
.
dateLastUpdated
=
item
.
dateLastUpdated
}
return
initialValues
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment