Skip to content

Commit

Permalink
fix: build warnings cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
PauMatas committed Mar 17, 2024
1 parent ec68d1c commit 4e6dc95
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/app/api/subject/all/value-label/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { db } from "@/lib/db"

export async function GET(req: Request) {
export async function GET() {
const subjects = await db.subject.findMany({
select: {
acronym: true,
Expand Down
11 changes: 1 addition & 10 deletions src/app/unansweredquestions/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
import { INFINITE_SCROLL_PAGINATION_RESULTS } from "@/config"
import { getAuthSession } from "@/lib/auth"
import { db } from "@/lib/db"
import QuestionFeed from "@/components/QuestionFeed"
import { buttonVariants } from "@/components/ui/Button"
import { HomeIcon } from "lucide-react"
import Link from "next/link"
import { cn } from "@/lib/utils"

interface PageProps {
params: {
slug: string
}
}

const page = async ({ params }: PageProps) => {
const { slug } = params
const session = await getAuthSession()
const page = async () => {
const questions = await db.question.findMany({
where: {
NOT: {
Expand Down
1 change: 0 additions & 1 deletion src/components/CreateAnswer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client"

import { Session } from "next-auth"
import { Button } from "@/components/ui/Button"
import { FC } from "react"
import UserAvatar from "./UserAvatar"
import Editor from "@/components/Editor"
Expand Down
3 changes: 1 addition & 2 deletions src/components/CreatePost.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import { Session } from "next-auth"
import { usePathname, useRouter } from "next/navigation"
import { usePathname } from "next/navigation"
import { FC } from "react"
import UserAvatar from "./UserAvatar"
import Link from "next/link"
Expand All @@ -12,7 +12,6 @@ interface CreatePostProps {
}

const CreatePost: FC<CreatePostProps> = ({ session }) => {
const router = useRouter()
const pathname = usePathname()

return (
Expand Down
9 changes: 1 addition & 8 deletions src/components/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
"use client"

import {
FC,
startTransition,
useCallback,
useEffect,
useRef,
useState,
} from "react"
import { FC, useCallback, useEffect, useRef, useState } from "react"
import TextareaAutosize from "react-textarea-autosize"
import { useForm } from "react-hook-form"
import {
Expand Down
5 changes: 4 additions & 1 deletion src/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ export function ProfileForm({
const response = await axios.get("/api/subject/all/value-label")
setAssignatures(response.data)
} catch (error) {
console.error("Error fetching subjects:", error)
toast({
title: "No s'han pogut carregar les assignatures",
description: `Error fetching subjects: ${error}`,
})
}
}
fetchAssignatures()
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const SearchBar: FC<SearchBarProps> = ({}) => {
_count: Prisma.QuestionCountOutputType
subject: Subject
})[]
const isFetching = queriesResults.some((query) => query.isFetching)
// const isFetching = queriesResults.some((query) => query.isFetching)
const isFetched = queriesResults.every((query) => query.isFetched)
const refetch = useCallback(() => {
subjectQueryResultsObjects.refetch()
Expand Down
2 changes: 1 addition & 1 deletion src/components/votes/AnswerAcceptClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const AnswerAcceptClient = ({

await axios.patch("/api/subject/answer/accept", payload)
},
onError: (err, accept) => {
onError: (err) => {
// reset current acceptation
setCurrentAccepted(prevAccepted)

Expand Down

0 comments on commit 4e6dc95

Please sign in to comment.