Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mrevanzak committed Jun 30, 2024
1 parent 6c903e7 commit e2ec866
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
16 changes: 7 additions & 9 deletions apps/web/src/app/(app)/@admin/documents/table.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import type { Document } from "@/server/api/routers/documents/documents.schema";
import type { SortDescriptor } from "@nextui-org/react";
import React, { useMemo } from "react";
import Link from "next/link";
import { useSearchParams } from "next/navigation";
Expand All @@ -13,7 +14,6 @@ import {
ModalFooter,
ModalHeader,
Pagination,
SortDescriptor,
Spinner,
Table,
TableBody,
Expand Down Expand Up @@ -71,9 +71,10 @@ export function DocumentsTable() {
});

const filteredData = useMemo(() => {
if (sort) {
const { column, direction } = sort;
data?.sort((a, b) => {
const { column, direction } = sort;

return data
?.sort((a, b) => {
switch (column) {
case "name":
return direction === "ascending"
Expand All @@ -86,11 +87,8 @@ export function DocumentsTable() {
default:
return 0;
}
});
}

return data
?.filter(
})
.filter(
(file) =>
file.name.toLowerCase().includes(search.toLowerCase()) ||
file.filename.toLowerCase().includes(search.toLowerCase()),
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/api/documents/[fileId]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function GET(_: Request, context: { params: { fileId: string } }) {
);

if (!res.ok) {
return await res.json();
return res;
}

return new Response(await res.arrayBuffer(), {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/sidebar/sidebar-user.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useState } from "react";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import { useRouter, useSearchParams } from "next/navigation";
import { Drawer, DrawerContent, DrawerTrigger } from "@/components/drawer";
import { HistoryList } from "@/components/history-list";
import { api } from "@/trpc/react";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/theme-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function ThemeToggle() {
disallowEmptySelection
selectionMode="single"
selectedKeys={[theme ?? "system"]}
onSelectionChange={async (keys) => {
onSelectionChange={(keys) => {
setTheme(Array.from(keys).at(0)?.toString() ?? "system");
}}
>
Expand Down

0 comments on commit e2ec866

Please sign in to comment.