Skip to content

Commit

Permalink
fix: Better error message when not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Dec 29, 2023
1 parent e732f59 commit 9c4fcad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/[lang]/dashboard/bulk/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import React from "react";
import { Dashboard } from "../Dashboard";
import { ENABLE_BULK } from "@/util/helpers";
import { getSubscription } from "@/supabase/supabaseServer";
import { getSession, getSubscription } from "@/supabase/supabaseServer";
import { dictionary } from "@/dictionaries";
import { cookies } from "next/headers";
import { createClient } from "@/supabase/server";
import { Csv } from "./Csv";
import { Spacer } from "@/components/Geist";
import { BulkHistory } from "./BulkHistory";
import { redirect } from "next/navigation";

export default async function Bulk({
params: { lang },
}: {
params: { lang: string };
}) {
const session = await getSession();
if (!session) {
return redirect(`/${lang}/login`);
}

const subscription = await getSubscription();
const d = await dictionary(lang);

Expand Down
11 changes: 11 additions & 0 deletions src/app/api/v1/bulk/[jobId]/download/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ export const GET = async (
);
}

if (!res.data.length) {
return Response.json(
{
error: "No results found",
},
{
status: 404,
}
);
}

const rows = res.data.map((row) => {
const result = row.result as CheckEmailOutput;
result.misc;
Expand Down

0 comments on commit 9c4fcad

Please sign in to comment.