feat: update form description
This commit is contained in:
parent
fd021426d1
commit
d4d094ec95
|
|
@ -57,6 +57,7 @@ import { getCsrfToken } from "@/service/auth";
|
||||||
import { Link } from "@/i18n/routing";
|
import { Link } from "@/i18n/routing";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
|
import { htmlToString } from "@/utils/globals";
|
||||||
|
|
||||||
interface FileWithPreview extends File {
|
interface FileWithPreview extends File {
|
||||||
preview: string;
|
preview: string;
|
||||||
|
|
@ -543,7 +544,7 @@ export default function FormAudio() {
|
||||||
} = {
|
} = {
|
||||||
...data,
|
...data,
|
||||||
title: finalTitle,
|
title: finalTitle,
|
||||||
description: finalDescription,
|
description: htmlToString(finalDescription),
|
||||||
htmlDescription: finalDescription,
|
htmlDescription: finalDescription,
|
||||||
fileTypeId,
|
fileTypeId,
|
||||||
categoryId: selectedCategory,
|
categoryId: selectedCategory,
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ import { getCsrfToken } from "@/service/auth";
|
||||||
import { Upload } from "tus-js-client";
|
import { Upload } from "tus-js-client";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
|
import { htmlToString } from "@/utils/globals";
|
||||||
|
|
||||||
const audioSchema = z.object({
|
const audioSchema = z.object({
|
||||||
title: z.string().min(1, { message: "Judul diperlukan" }),
|
title: z.string().min(1, { message: "Judul diperlukan" }),
|
||||||
|
|
@ -348,7 +349,7 @@ export default function FormAudioUpdate() {
|
||||||
...data,
|
...data,
|
||||||
id: detail?.id,
|
id: detail?.id,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
description: data.description,
|
description: htmlToString(data.description),
|
||||||
htmlDescription: data.description,
|
htmlDescription: data.description,
|
||||||
fileTypeId,
|
fileTypeId,
|
||||||
categoryId: selectedTarget,
|
categoryId: selectedTarget,
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ import { Link } from "@/i18n/routing";
|
||||||
import { request } from "http";
|
import { request } from "http";
|
||||||
import { useLocale, useTranslations } from "next-intl";
|
import { useLocale, useTranslations } from "next-intl";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
import { htmlToString } from "@/utils/globals";
|
||||||
|
|
||||||
interface FileWithPreview extends File {
|
interface FileWithPreview extends File {
|
||||||
preview: string;
|
preview: string;
|
||||||
|
|
@ -564,7 +565,7 @@ export default function FormImage() {
|
||||||
} = {
|
} = {
|
||||||
...data,
|
...data,
|
||||||
title: finalTitle,
|
title: finalTitle,
|
||||||
description: finalDescription,
|
description: htmlToString(finalDescription),
|
||||||
htmlDescription: finalDescription,
|
htmlDescription: finalDescription,
|
||||||
fileTypeId,
|
fileTypeId,
|
||||||
categoryId: selectedCategory,
|
categoryId: selectedCategory,
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ import { error, loading } from "@/lib/swal";
|
||||||
import { getCsrfToken } from "@/service/auth";
|
import { getCsrfToken } from "@/service/auth";
|
||||||
import { Upload } from "tus-js-client";
|
import { Upload } from "tus-js-client";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import { htmlToString } from "@/utils/globals";
|
||||||
|
|
||||||
const imageSchema = z.object({
|
const imageSchema = z.object({
|
||||||
title: z.string().min(1, { message: "Judul diperlukan" }),
|
title: z.string().min(1, { message: "Judul diperlukan" }),
|
||||||
|
|
@ -358,7 +359,7 @@ export default function FormImageUpdate() {
|
||||||
...data,
|
...data,
|
||||||
id: detail?.id,
|
id: detail?.id,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
description: data.description,
|
description: htmlToString(data.description),
|
||||||
htmlDescription: data.description,
|
htmlDescription: data.description,
|
||||||
fileTypeId,
|
fileTypeId,
|
||||||
categoryId: selectedTarget,
|
categoryId: selectedTarget,
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ import dynamic from "next/dynamic";
|
||||||
import { getCsrfToken } from "@/service/auth";
|
import { getCsrfToken } from "@/service/auth";
|
||||||
import { Link } from "@/i18n/routing";
|
import { Link } from "@/i18n/routing";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import { htmlToString } from "@/utils/globals";
|
||||||
|
|
||||||
interface FileWithPreview extends File {
|
interface FileWithPreview extends File {
|
||||||
preview: string;
|
preview: string;
|
||||||
|
|
@ -573,7 +574,7 @@ export default function FormTeks() {
|
||||||
} = {
|
} = {
|
||||||
...data,
|
...data,
|
||||||
title: finalTitle,
|
title: finalTitle,
|
||||||
description: finalDescription,
|
description: htmlToString(finalDescription),
|
||||||
htmlDescription: finalDescription,
|
htmlDescription: finalDescription,
|
||||||
fileTypeId,
|
fileTypeId,
|
||||||
categoryId: selectedCategory,
|
categoryId: selectedCategory,
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ import { Upload } from "tus-js-client";
|
||||||
import { getCsrfToken } from "@/service/auth";
|
import { getCsrfToken } from "@/service/auth";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
|
import { htmlToString } from "@/utils/globals";
|
||||||
|
|
||||||
const teksSchema = z.object({
|
const teksSchema = z.object({
|
||||||
title: z.string().min(1, { message: "Judul diperlukan" }),
|
title: z.string().min(1, { message: "Judul diperlukan" }),
|
||||||
|
|
@ -337,7 +338,7 @@ export default function FormTeksUpdate() {
|
||||||
...data,
|
...data,
|
||||||
id: detail?.id,
|
id: detail?.id,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
description: data.description,
|
description: htmlToString(data.description),
|
||||||
htmlDescription: data.description,
|
htmlDescription: data.description,
|
||||||
fileTypeId,
|
fileTypeId,
|
||||||
categoryId: selectedTarget,
|
categoryId: selectedTarget,
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ import {
|
||||||
Legend,
|
Legend,
|
||||||
ChartOptions,
|
ChartOptions,
|
||||||
} from "chart.js";
|
} from "chart.js";
|
||||||
|
import { htmlToString } from "@/utils/globals";
|
||||||
|
|
||||||
ChartJS.register(ArcElement, Tooltip, Legend);
|
ChartJS.register(ArcElement, Tooltip, Legend);
|
||||||
const imageSchema = z.object({
|
const imageSchema = z.object({
|
||||||
|
|
@ -349,7 +350,7 @@ export default function FormTeksSeo() {
|
||||||
...data,
|
...data,
|
||||||
id: detail?.id,
|
id: detail?.id,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
description: data.description,
|
description: htmlToString(data.description),
|
||||||
htmlDescription: data.description,
|
htmlDescription: data.description,
|
||||||
fileTypeId,
|
fileTypeId,
|
||||||
categoryId: selectedTarget,
|
categoryId: selectedTarget,
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ import dynamic from "next/dynamic";
|
||||||
import { getCsrfToken } from "@/service/auth";
|
import { getCsrfToken } from "@/service/auth";
|
||||||
import { Link } from "@/i18n/routing";
|
import { Link } from "@/i18n/routing";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import { htmlToString } from "@/utils/globals";
|
||||||
|
|
||||||
const CustomEditor = dynamic(
|
const CustomEditor = dynamic(
|
||||||
() => {
|
() => {
|
||||||
|
|
@ -559,7 +560,7 @@ export default function FormVideo() {
|
||||||
} = {
|
} = {
|
||||||
...data,
|
...data,
|
||||||
title: finalTitle,
|
title: finalTitle,
|
||||||
description: finalDescription,
|
description: htmlToString(finalDescription),
|
||||||
htmlDescription: finalDescription,
|
htmlDescription: finalDescription,
|
||||||
fileTypeId,
|
fileTypeId,
|
||||||
categoryId: selectedCategory,
|
categoryId: selectedCategory,
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ import { getCsrfToken } from "@/service/auth";
|
||||||
import { error, loading } from "@/lib/swal";
|
import { error, loading } from "@/lib/swal";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
|
import { htmlToString } from "@/utils/globals";
|
||||||
|
|
||||||
const videoSchema = z.object({
|
const videoSchema = z.object({
|
||||||
title: z.string().min(1, { message: "Judul diperlukan" }),
|
title: z.string().min(1, { message: "Judul diperlukan" }),
|
||||||
|
|
@ -423,7 +424,7 @@ export default function FormVideoUpdate() {
|
||||||
...data,
|
...data,
|
||||||
id: detail?.id,
|
id: detail?.id,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
description: data.description,
|
description: htmlToString(data.description),
|
||||||
htmlDescription: data.description,
|
htmlDescription: data.description,
|
||||||
fileTypeId,
|
fileTypeId,
|
||||||
categoryId: selectedTarget,
|
categoryId: selectedTarget,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue