mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-05-04 04:33:10 +00:00
Formated Files
This commit is contained in:
parent
d5631b309a
commit
e768d9181f
138 changed files with 1829 additions and 1851 deletions
|
@ -1,18 +1,18 @@
|
|||
"use server";
|
||||
'use server';
|
||||
|
||||
import { auth } from "@clerk/nextjs";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { auth } from '@clerk/nextjs';
|
||||
import { revalidatePath } from 'next/cache';
|
||||
|
||||
import { db } from "@/lib/db";
|
||||
import { createSafeAction } from "@/lib/create-safe-action";
|
||||
import { db } from '@/lib/db';
|
||||
import { createSafeAction } from '@/lib/create-safe-action';
|
||||
|
||||
import { InputType, ReturnType } from "./types";
|
||||
import { UpdateCardOrder } from "./schema";
|
||||
import { InputType, ReturnType } from './types';
|
||||
import { UpdateCardOrder } from './schema';
|
||||
|
||||
const handler = async (data: InputType): Promise<ReturnType> => {
|
||||
const { userId, orgId } = auth();
|
||||
|
||||
if (!userId || !orgId) return { error: "Unauthorized" };
|
||||
if (!userId || !orgId) return { error: 'Unauthorized' };
|
||||
|
||||
const { items, boardId } = data;
|
||||
let updatedCards;
|
||||
|
@ -38,7 +38,7 @@ const handler = async (data: InputType): Promise<ReturnType> => {
|
|||
updatedCards = await db.$transaction(transaction);
|
||||
} catch (error) {
|
||||
return {
|
||||
error: "Failed to reorder list",
|
||||
error: 'Failed to reorder list',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { z } from "zod";
|
||||
import { z } from 'zod';
|
||||
|
||||
export const UpdateCardOrder = z.object({
|
||||
items: z.array(
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { z } from "zod";
|
||||
import { Card } from "@prisma/client";
|
||||
import { z } from 'zod';
|
||||
import { Card } from '@prisma/client';
|
||||
|
||||
import { ActionState } from "@/lib/create-safe-action";
|
||||
import { ActionState } from '@/lib/create-safe-action';
|
||||
|
||||
import { UpdateCardOrder } from "./schema";
|
||||
import { UpdateCardOrder } from './schema';
|
||||
|
||||
export type InputType = z.infer<typeof UpdateCardOrder>;
|
||||
export type ReturnType = ActionState<InputType, Card[]>;
|
||||
export type InputType = z.infer<typeof UpdateCardOrder>;
|
||||
export type ReturnType = ActionState<InputType, Card[]>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue