forked from Mirrors/elk
fix: setting default values for draft
This commit is contained in:
parent
e11ed6250d
commit
26f2dec6b6
1 changed files with 8 additions and 7 deletions
|
@ -23,13 +23,14 @@ export const currentUserDrafts = computed(() => {
|
||||||
return allDrafts.value[id]
|
return allDrafts.value[id]
|
||||||
})
|
})
|
||||||
|
|
||||||
export function getDefaultDraft({
|
export function getDefaultDraft(options: Partial<Draft['params'] & Omit<Draft, 'params'>> = {}): Draft {
|
||||||
|
const {
|
||||||
status = '',
|
status = '',
|
||||||
inReplyToId,
|
inReplyToId,
|
||||||
visibility = 'public',
|
visibility = 'public',
|
||||||
placeholder = 'What is on your mind?',
|
placeholder = 'What is on your mind?',
|
||||||
attachments = [],
|
attachments = [],
|
||||||
}: Partial<Draft['params'] & Omit<Draft, 'params'>> = {}): Draft {
|
} = options
|
||||||
return {
|
return {
|
||||||
params: {
|
params: {
|
||||||
status,
|
status,
|
||||||
|
|
Loading…
Reference in a new issue