mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-05-04 12:43:24 +00:00
Added Redis for Caching and Started Database Query Caching Migration to Redis
This commit is contained in:
parent
f99360d9b9
commit
0f899cb34f
12 changed files with 260 additions and 632 deletions
|
@ -1,7 +1,7 @@
|
|||
'use server';
|
||||
|
||||
import { auth } from '@clerk/nextjs/server';
|
||||
import { revalidatePath } from 'next/cache';
|
||||
import { revalidatePath, revalidateTag } from 'next/cache';
|
||||
|
||||
import { db } from '@/lib/db';
|
||||
import { createSafeAction } from '@/lib/create-safe-action';
|
||||
|
@ -36,6 +36,9 @@ const handler = async (data: InputType): Promise<ReturnType> => {
|
|||
);
|
||||
|
||||
updatedCards = await db.$transaction(transaction);
|
||||
items.map((card) => {
|
||||
revalidateTag(`card-${card.id}`);
|
||||
});
|
||||
} catch (error) {
|
||||
return {
|
||||
error: 'Failed to reorder list',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue