mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(database): 🔥 Always import SQL operators directly from drizzle
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 0s
Build Docker Images / lint (push) Failing after 7s
Build Docker Images / tests (push) Failing after 7s
Deploy Docs to GitHub Pages / build (push) Failing after 0s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Mirror to Codeberg / Mirror (push) Failing after 0s
Nix Build / check (push) Failing after 0s
Test Publish / build (client) (push) Failing after 0s
Test Publish / build (sdk) (push) Failing after 0s
Build Docker Images / check (push) Failing after 7s
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 0s
Build Docker Images / lint (push) Failing after 7s
Build Docker Images / tests (push) Failing after 7s
Deploy Docs to GitHub Pages / build (push) Failing after 0s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Mirror to Codeberg / Mirror (push) Failing after 0s
Nix Build / check (push) Failing after 0s
Test Publish / build (client) (push) Failing after 0s
Test Publish / build (sdk) (push) Failing after 0s
Build Docker Images / check (push) Failing after 7s
This commit is contained in:
parent
d3f411915f
commit
9eac364e01
14 changed files with 23 additions and 25 deletions
|
|
@ -76,7 +76,7 @@ export default apiRoute((app) => {
|
|||
|
||||
if (timeline.includes("home")) {
|
||||
const found = await db.query.Markers.findFirst({
|
||||
where: (marker, { and, eq }): SQL | undefined =>
|
||||
where: (marker): SQL | undefined =>
|
||||
and(
|
||||
eq(marker.userId, user.id),
|
||||
eq(marker.timeline, "home"),
|
||||
|
|
@ -102,7 +102,7 @@ export default apiRoute((app) => {
|
|||
|
||||
if (timeline.includes("notifications")) {
|
||||
const found = await db.query.Markers.findFirst({
|
||||
where: (marker, { and, eq }): SQL | undefined =>
|
||||
where: (marker): SQL | undefined =>
|
||||
and(
|
||||
eq(marker.userId, user.id),
|
||||
eq(marker.timeline, "notifications"),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { RolePermission, Status as StatusSchema } from "@versia/client/schemas";
|
||||
import { db } from "@versia/kit/db";
|
||||
import type { SQL } from "drizzle-orm";
|
||||
import { and, eq, type SQL } from "drizzle-orm";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { resolver } from "hono-openapi/zod";
|
||||
import { apiRoute, auth, withNoteParam } from "@/api";
|
||||
|
|
@ -51,7 +51,7 @@ export default apiRoute((app) =>
|
|||
|
||||
if (
|
||||
await db.query.UserToPinnedNotes.findFirst({
|
||||
where: (userPinnedNote, { and, eq }): SQL | undefined =>
|
||||
where: (userPinnedNote): SQL | undefined =>
|
||||
and(
|
||||
eq(userPinnedNote.noteId, note.data.id),
|
||||
eq(userPinnedNote.userId, user.id),
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export default apiRoute((app) => {
|
|||
const { id } = context.req.valid("param");
|
||||
|
||||
const userFilter = await db.query.Filters.findFirst({
|
||||
where: (filter, { eq, and }): SQL | undefined =>
|
||||
where: (filter): SQL | undefined =>
|
||||
and(eq(filter.userId, user.id), eq(filter.id, id)),
|
||||
with: {
|
||||
keywords: true,
|
||||
|
|
@ -224,7 +224,7 @@ export default apiRoute((app) => {
|
|||
}
|
||||
|
||||
const updatedFilter = await db.query.Filters.findFirst({
|
||||
where: (filter, { eq, and }): SQL | undefined =>
|
||||
where: (filter): SQL | undefined =>
|
||||
and(eq(filter.userId, user.id), eq(filter.id, id)),
|
||||
with: {
|
||||
keywords: true,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
import { db } from "@versia/kit/db";
|
||||
import { FilterKeywords, Filters } from "@versia/kit/tables";
|
||||
import { randomUUIDv7 } from "bun";
|
||||
import type { SQL } from "drizzle-orm";
|
||||
import { eq, type SQL } from "drizzle-orm";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { resolver, validator } from "hono-openapi/zod";
|
||||
import { z } from "zod";
|
||||
|
|
@ -44,8 +44,7 @@ export default apiRoute((app) => {
|
|||
const { user } = context.get("auth");
|
||||
|
||||
const userFilters = await db.query.Filters.findMany({
|
||||
where: (filter, { eq }): SQL | undefined =>
|
||||
eq(filter.userId, user.id),
|
||||
where: (filter): SQL | undefined => eq(filter.userId, user.id),
|
||||
with: {
|
||||
keywords: true,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue