Skip to content

Commit

Permalink
Debugging Upstash #13
Browse files Browse the repository at this point in the history
  • Loading branch information
david emioma committed Apr 3, 2024
1 parent ed39d7d commit 6be5302
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
env:
VERCEL_ENV: preview
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}

test:
needs: preview-deployment
Expand Down
2 changes: 1 addition & 1 deletion app/api/cart/[cartItemId]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { z } from "zod";
import prismadb from "@/lib/prisma";
import { UserRole } from "@prisma/client";
import { NextResponse } from "next/server";
import { currentRole, currentUser } from "@/lib/auth";
import { cacheCartData } from "@/data/redis-data";
import { currentRole, currentUser } from "@/lib/auth";

export async function PATCH(
request: Request,
Expand Down
4 changes: 2 additions & 2 deletions lib/redis.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Redis } from "@upstash/redis";
import { Ratelimit } from "@upstash/ratelimit";

const url = process.env.UPSTASH_REDIS_REST_URL;
const url = process.env.UPSTASH_REDIS_REST_URL as string;

const token = process.env.UPSTASH_REDIS_REST_TOKEN;
const token = process.env.UPSTASH_REDIS_REST_TOKEN as string;

if (!url || !token) {
throw new Error(
Expand Down

0 comments on commit 6be5302

Please sign in to comment.