Issue-178 Add draft mode for IDE

resolves #178
Initially the UI forced users to create a "part" before they got access
to the ide, now we're letting users go straight to hacking in the ide
and saving can come later. Better at getting users to the code earlier
This commit is contained in:
Kurt Hutten
2020-12-29 18:53:49 +11:00
parent 7f5b48a959
commit c84dcda4a1
9 changed files with 148 additions and 56 deletions

View File

@@ -117,7 +117,7 @@ export const Success = ({ userPart, variables: { isEditable }, refetch }) => {
addMessage('Part updated.', { classes: 'rw-flash-success' })
},
})
const [createUser] = useMutation(CREATE_PART_MUTATION, {
const [createPart] = useMutation(CREATE_PART_MUTATION, {
onCompleted: ({ createPart }) => {
navigate(
routes.part({
@@ -130,7 +130,7 @@ export const Success = ({ userPart, variables: { isEditable }, refetch }) => {
})
const onSave = (id, input) => {
if (!id) {
createUser({ variables: { input } })
createPart({ variables: { input } })
return
}
updateUser({ variables: { id, input } })