Skip to content

Commit

Permalink
fix: create tags from drawer (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sembauke authored Jan 27, 2024
1 parent 3ff9d3c commit 4130880
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/frontend/src/components/editor-drawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ import {
DrawerHeader,
DrawerOverlay,
DrawerContent,
useToast,
} from "@chakra-ui/react";
import { Field, Form, Formik } from "formik";
import slugify from "slugify";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faGear } from "@fortawesome/free-solid-svg-icons";
import { createTag } from "@/lib/tags";

const EditorDrawer = ({
tags,
Expand Down Expand Up @@ -64,6 +66,8 @@ const EditorDrawer = ({

const [authorName, setAuthorName] = useState("");

const toast = useToast();

useEffect(() => {
if (post) {
const { tags } = post.attributes;
Expand Down Expand Up @@ -157,7 +161,7 @@ const EditorDrawer = ({
} catch (error) {
toast({
title: "An error occurred.",
description: error,
description: error.message,
status: "error",
duration: 5000,
isClosable: true,
Expand Down

0 comments on commit 4130880

Please sign in to comment.