rename draft to unlisted
This commit is contained in:
@@ -64,7 +64,7 @@ const formSchema = z
|
||||
rawfile: z
|
||||
.instanceof(File, { message: 'Anexe um arquivo HTML' })
|
||||
.optional(),
|
||||
draft: z.boolean()
|
||||
unlisted: z.boolean()
|
||||
})
|
||||
.refine(
|
||||
(data) => {
|
||||
@@ -92,7 +92,7 @@ export type Course = {
|
||||
name: string
|
||||
access_period: number
|
||||
cert?: Cert
|
||||
draft?: boolean
|
||||
unlisted?: boolean
|
||||
}
|
||||
|
||||
export function meta({}: Route.MetaArgs) {
|
||||
@@ -164,7 +164,7 @@ function Editing() {
|
||||
const form = useForm({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
draft: false,
|
||||
unlisted: false,
|
||||
given_cert: !!course?.cert,
|
||||
never_expires: !course?.cert?.exp_interval,
|
||||
...course
|
||||
@@ -373,7 +373,7 @@ function Editing() {
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="draft"
|
||||
name="unlisted"
|
||||
render={({ field: { onChange, value, ...field } }) => (
|
||||
<FormItem className="flex items-center gap-2">
|
||||
<FormControl>
|
||||
@@ -383,7 +383,7 @@ function Editing() {
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormLabel>Ocultar o curso no catálogo</FormLabel>
|
||||
<FormLabel>Não listar no catálogo de cursos</FormLabel>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user