Create titres
This commit is contained in:
@@ -25,7 +25,8 @@ export default function CreateForm({
|
||||
dialogText,
|
||||
collection,
|
||||
title,
|
||||
label
|
||||
label,
|
||||
hasMultiline = true
|
||||
}) {
|
||||
const countdownRef = useRef()
|
||||
|
||||
@@ -45,6 +46,11 @@ export default function CreateForm({
|
||||
titre: selectedTitre,
|
||||
status: 'draft',
|
||||
}
|
||||
} else if (collection === 'titres') {
|
||||
requestObject = {
|
||||
contenu: formattedContent,
|
||||
status: 'draft',
|
||||
}
|
||||
}
|
||||
|
||||
await handleSubmit({
|
||||
@@ -80,8 +86,8 @@ export default function CreateForm({
|
||||
<TextField
|
||||
autoFocus
|
||||
required
|
||||
multiline
|
||||
fullWidth
|
||||
multiline={Boolean(hasMultiline)}
|
||||
mt={2}
|
||||
rows={4}
|
||||
id='content'
|
||||
@@ -101,7 +107,7 @@ export default function CreateForm({
|
||||
|
||||
CreateForm.propTypes = {
|
||||
session: PropTypes.object,
|
||||
selectedTitre: PropTypes.object.isRequired,
|
||||
selectedTitre: PropTypes.object,
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
setIsOpen: PropTypes.func.isRequired,
|
||||
setError: PropTypes.func.isRequired,
|
||||
@@ -111,5 +117,6 @@ CreateForm.propTypes = {
|
||||
dialogText: PropTypes.string.isRequired,
|
||||
collection: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
label: PropTypes.string.isRequired
|
||||
label: PropTypes.string.isRequired,
|
||||
hasMultiline: PropTypes.bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user