remove hardcoded default template, always use seeded templates
This commit is contained in:
@@ -72,7 +72,7 @@ export default function PostForm({ boardSlug, boardId, onSubmit, onCancel }: Pro
|
|||||||
api.get<{ templates: Template[] }>(`/boards/${boardSlug}/templates`)
|
api.get<{ templates: Template[] }>(`/boards/${boardSlug}/templates`)
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
setTemplates(r.templates)
|
setTemplates(r.templates)
|
||||||
const def = r.templates.find((t) => t.isDefault)
|
const def = r.templates.find((t) => t.isDefault) || r.templates[0]
|
||||||
if (def) setSelectedTemplateId(def.id)
|
if (def) setSelectedTemplateId(def.id)
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
@@ -294,20 +294,6 @@ export default function PostForm({ boardSlug, boardId, onSubmit, onCancel }: Pro
|
|||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
{label('Template')}
|
{label('Template')}
|
||||||
<div className="flex gap-2 flex-wrap">
|
<div className="flex gap-2 flex-wrap">
|
||||||
<button
|
|
||||||
onClick={() => handleTemplateChange('')}
|
|
||||||
className="px-3 py-1.5 font-medium"
|
|
||||||
style={{
|
|
||||||
background: !selectedTemplateId ? 'var(--accent-subtle)' : 'transparent',
|
|
||||||
color: !selectedTemplateId ? 'var(--accent)' : 'var(--text-tertiary)',
|
|
||||||
border: `1px solid ${!selectedTemplateId ? 'var(--accent)' : 'var(--border)'}`,
|
|
||||||
borderRadius: 'var(--radius-md)',
|
|
||||||
fontSize: 'var(--text-xs)',
|
|
||||||
transition: 'all var(--duration-fast) ease-out',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Default
|
|
||||||
</button>
|
|
||||||
{templates.map((t) => (
|
{templates.map((t) => (
|
||||||
<button
|
<button
|
||||||
key={t.id}
|
key={t.id}
|
||||||
|
|||||||
Reference in New Issue
Block a user