mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 18:33:01 +00:00
shared zod types and drizzle schema
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { eq, sql, and } from "drizzle-orm";
|
||||
import { db } from "../client";
|
||||
import { Issue } from "../schema";
|
||||
import { Issue } from "@issue/shared";
|
||||
|
||||
export async function createIssue(projectId: number, title: string, description: string) {
|
||||
// prevents two issues with the same unique number
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { eq } from "drizzle-orm";
|
||||
import { db } from "../client";
|
||||
import { Issue, Project, User } from "../schema";
|
||||
import { Issue, Project, User } from "@issue/shared";
|
||||
|
||||
export async function createProject(blob: string, name: string, ownerId: number) {
|
||||
const [project] = await db
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { eq } from "drizzle-orm";
|
||||
import { db } from "../client";
|
||||
import { User } from "../schema";
|
||||
import { User } from "@issue/shared";
|
||||
|
||||
export async function createUser(name: string, username: string) {
|
||||
const [user] = await db.insert(User).values({ name, username }).returning();
|
||||
|
||||
Reference in New Issue
Block a user