Skip to content

Commit

Permalink
fix: build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ephraimduncan committed Feb 25, 2024
1 parent bcd1972 commit a114066
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/(main)/dashboard/_components/delete-form-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TrashIcon } from "@radix-ui/react-icons";
import { useRouter } from "next/navigation";
import React from "react";
import { useState } from "react";
import { toast } from "sonner";

import { Button } from "~/components/ui/button";
Expand All @@ -19,7 +19,7 @@ type DeleteFormDialogProps = {
};

export function DeleteFormDialog({ formId }: DeleteFormDialogProps) {
const [open, setOpen] = React.useState(false);
const [open, setOpen] = useState(false);

const router = useRouter();
const { mutateAsync: deleteForm } = api.form.delete.useMutation();
Expand Down
1 change: 1 addition & 0 deletions src/app/api/s/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { eq } from "drizzle-orm";
import { nanoid as generateId } from "nanoid";

import { renderNewSubmissionEmail } from "~/lib/email-templates/new-submission";
import { db } from "~/server/db";
import { formDatas, forms } from "~/server/db/schema";
Expand Down
3 changes: 2 additions & 1 deletion src/lib/flatten-object.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
interface FlattenedObject {
[key: string]: any;
}
Expand All @@ -8,7 +9,7 @@ export const flattenObject = (
): FlattenedObject => {
let flattenedObj: FlattenedObject = {};

for (let key in obj) {
for (const key in obj) {
if (typeof obj[key] === "object" && !Array.isArray(obj[key])) {
const nestedObj = flattenObject(obj[key], `${parentKey}${key}.`);
flattenedObj = { ...flattenedObj, ...nestedObj };
Expand Down
1 change: 1 addition & 0 deletions src/server/api/routers/formData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { eq } from "drizzle-orm";
import { nanoid as generateId } from "nanoid";
import { z } from "zod";

import { flattenObject } from "~/lib/flatten-object";
import { formDatas, forms } from "~/server/db/schema";

Expand Down

0 comments on commit a114066

Please sign in to comment.