mirror of
https://github.com/fergalmoran/opengifame.git
synced 2025-12-22 17:49:18 +00:00
Fix some lint errors
This commit is contained in:
@@ -112,7 +112,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
||||
"@typescript-eslint/parser": "^8.7.0",
|
||||
"drizzle-kit": "^0.24.2",
|
||||
"eslint": "^9.11.1",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-next": "^14.2.13",
|
||||
"eslint-plugin-drizzle": "^0.2.3",
|
||||
"jest": "^29.7.0",
|
||||
|
||||
@@ -18,7 +18,7 @@ const PostActions: React.FC<PostActionsProps> = ({ post }) => {
|
||||
title="Upvote"
|
||||
action={async () => {
|
||||
await vote.mutateAsync({ slug: post.slug, up: true });
|
||||
voteCount.refetch();
|
||||
await voteCount.refetch();
|
||||
}}
|
||||
icon={<Icons.up className="h-6 w-6" />}
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"use client";
|
||||
import { Post } from "@/lib/models/post";
|
||||
import { type Post } from "@/lib/models/post";
|
||||
import { api } from "@/trpc/react";
|
||||
import React from "react";
|
||||
import { Icons } from "@/components/icons";
|
||||
@@ -14,7 +14,7 @@ const VoteCount: React.FC<VoteCountProps> = ({ post }) => {
|
||||
return (
|
||||
<span>
|
||||
{voteCount.data ? (
|
||||
voteCount.data.toString()
|
||||
`${voteCount.data.voteCount} votes`
|
||||
) : (
|
||||
<Icons.spinner className="animate-spin" />
|
||||
)}
|
||||
|
||||
@@ -2,7 +2,7 @@ const clipboardImageToFile = (
|
||||
data: DataTransfer,
|
||||
callback: (result: File | null | undefined) => void,
|
||||
) => {
|
||||
var items = data.items;
|
||||
const items = data.items;
|
||||
|
||||
if (items == undefined || items.length == 0) {
|
||||
if (typeof callback == "function") {
|
||||
@@ -10,10 +10,9 @@ const clipboardImageToFile = (
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
// Skip content if not image
|
||||
if (items[i]?.type.indexOf("image") == -1) continue;
|
||||
var blob = items[i]?.getAsFile();
|
||||
for (const item of items) {
|
||||
if (!item.type.includes("image")) continue;
|
||||
const blob = item.getAsFile();
|
||||
|
||||
if (typeof callback == "function") {
|
||||
callback(blob);
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import { NextRequest, NextResponse, URLPattern } from "next/server";
|
||||
import { promises as fs } from "fs";
|
||||
import mime from "mime-types";
|
||||
import { env } from "./env";
|
||||
|
||||
export { default } from "next-auth/middleware";
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export const postRouter = createTRPCRouter({
|
||||
.execute(sql`SELECT SUM(CASE WHEN up = TRUE THEN 1 ELSE -1 END)
|
||||
FROM public.votes v
|
||||
WHERE v.post_id = (SELECT id FROM posts WHERE slug = ${input.slug})`);
|
||||
return count[0]?.sum ?? '0';
|
||||
return { voteCount: count[0]?.sum ?? "0" };
|
||||
}),
|
||||
getBySlug: publicProcedure
|
||||
.input(z.object({ slug: z.string() }))
|
||||
@@ -102,9 +102,9 @@ export const postRouter = createTRPCRouter({
|
||||
}),
|
||||
)
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
var slugify = slugifyWithCounter();
|
||||
var found = false;
|
||||
var slug = "";
|
||||
const slugify = slugifyWithCounter();
|
||||
let found = false;
|
||||
let slug = "";
|
||||
do {
|
||||
slug = slugify(input.title);
|
||||
const existing = await ctx.db
|
||||
|
||||
@@ -150,7 +150,6 @@ body {
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
@variants responsive {
|
||||
.masonry {
|
||||
column-gap: 1.5em;
|
||||
column-count: 1;
|
||||
@@ -171,4 +170,3 @@ body {
|
||||
break-inside: avoid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user