Made a lotta small fixes
This commit is contained in:
parent
801b72eb67
commit
92d8f9af81
@ -1,7 +1,7 @@
|
|||||||
Name,Type,WarehouseArea,Description,EarthquakeCode,Price,Required,PickedUp,Picture
|
Name,Type,WarehouseArea,Description,EarthquakeCode,Price,Required,PickedUp,Picture
|
||||||
Echo Bomb,Lava,ShelvingAreaA,A dense glossy black volcanic bomb with minor vesicles.,EV-7.4-Mexico-00035,120,no,no,EchoBomb.PNG
|
Echo Bomb,Lava,ShelvingAreaA,A dense glossy black volcanic bomb with minor vesicles.,EV-7.4-Mexico-00035,120,no,no,EchoBomb.PNG
|
||||||
Silvershade Ash,Ash,ShelvingAreaD,Fine light-grey volcanic ash collected near a village.,EV-6.0-Iceland-00018,40,no,no,SilvershadeAsh.PNG
|
Silvershade Ash,Ash,ShelvingAreaD,Fine light-grey volcanic ash collected near a village.,EV-6.0-Iceland-00018,40,no,no,SilvershadeAsh.PNG
|
||||||
Strata Core,Soil,LoggingArea,Soil core with visible stratification showing evidence of liquefaction.,ET-6.9-Brazil-00046,30,no,no,StrataCore.PNG
|
Strata Core,Soil,LoggingArea,Soil core with visible stratification showing evidence of liquefaction.,EE-8.3-Brazil-01208,30,no,no,StrataCore.PNG
|
||||||
Opal Clast,Tephra,ShelvingAreaM,Pumice clast with sharp edges and clear layering.,EV-8.3-Iceland-00127,65,no,no,OpalClast.PNG
|
Opal Clast,Tephra,ShelvingAreaM,Pumice clast with sharp edges and clear layering.,EV-8.3-Iceland-00127,65,no,no,OpalClast.PNG
|
||||||
Magnetite Ash,Ash,PalletDeliveryArea,Bagged black ash sample with high magnetic content.,EV-5.3-Myanmar-00088,28,yes,no,MagnetiteAsh.PNG
|
Magnetite Ash,Ash,PalletDeliveryArea,Bagged black ash sample with high magnetic content.,EV-5.3-Myanmar-00088,28,yes,no,MagnetiteAsh.PNG
|
||||||
Ropeform Fragment,Lava,ShelvingAreaR,Ropey pahoehoe lava fragment with preserved ripples.,EV-6.9-Ethiopia-00012,85,no,no,RopeformFragment.PNG
|
Ropeform Fragment,Lava,ShelvingAreaR,Ropey pahoehoe lava fragment with preserved ripples.,EV-6.9-Ethiopia-00012,85,no,no,RopeformFragment.PNG
|
||||||
|
|||||||
|
1558
public/Earthquakes-Long.csv
Normal file
1558
public/Earthquakes-Long.csv
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,13 +1,10 @@
|
|||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
import { prisma } from '@utils/prisma';
|
import { prisma } from "@utils/prisma";
|
||||||
|
|
||||||
// todo add specification of date range in request
|
|
||||||
|
|
||||||
export async function POST(req: Request) {
|
export async function POST(req: Request) {
|
||||||
try {
|
try {
|
||||||
const json = await req.json();
|
const { rangeDaysPrev } = await req.json();
|
||||||
const { rangeDaysPrev } = json.body;
|
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const rangeBeginning = new Date();
|
const rangeBeginning = new Date();
|
||||||
|
|||||||
@ -2,9 +2,10 @@ import { parse } from "csv-parse/sync";
|
|||||||
import fs from "fs/promises";
|
import fs from "fs/promises";
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
|
import { getRandomNumber } from "@utils/maths";
|
||||||
import { stringToBool } from "@utils/parsingUtils";
|
import { stringToBool } from "@utils/parsingUtils";
|
||||||
import { prisma } from "@utils/prisma";
|
import { prisma } from "@utils/prisma";
|
||||||
import { getRandomNumber } from "@utils/maths";
|
|
||||||
|
|
||||||
const csvFilePath = path.resolve(process.cwd(), "public/Artefacts.csv");
|
const csvFilePath = path.resolve(process.cwd(), "public/Artefacts.csv");
|
||||||
|
|
||||||
@ -54,11 +55,11 @@ export async function POST() {
|
|||||||
type: row.Type,
|
type: row.Type,
|
||||||
warehouseArea: row.WarehouseArea,
|
warehouseArea: row.WarehouseArea,
|
||||||
earthquakeId: earthquake.id,
|
earthquakeId: earthquake.id,
|
||||||
required: stringToBool(row.Required, true),
|
isRequired: stringToBool(row.Required, true),
|
||||||
shopPrice: row.Price && row.Price !== "" ? parseFloat(row.Price) : getRandomNumber(20, 500),
|
shopPrice: row.Price && row.Price !== "" ? parseFloat(row.Price) : getRandomNumber(20, 500),
|
||||||
pickedUp: stringToBool(row.PickedUp, false),
|
isSold: false,
|
||||||
|
isCollected: false,
|
||||||
creatorId: randomCreator.id,
|
creatorId: randomCreator.id,
|
||||||
purchasedById: null,
|
|
||||||
imageName: row.Picture,
|
imageName: row.Picture,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|||||||
@ -105,35 +105,38 @@ export async function POST() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Bulk insert earthquakes and connect observatories in a transaction
|
// Bulk insert earthquakes and connect observatories in a transaction
|
||||||
await prisma.$transaction(async (tx) => {
|
await prisma.$transaction(
|
||||||
// Insert earthquakes
|
async (tx) => {
|
||||||
await tx.earthquake.createMany({
|
// Insert earthquakes
|
||||||
data: validEarthquakes.map((eq) => eq.data),
|
await tx.earthquake.createMany({
|
||||||
});
|
data: validEarthquakes.map((eq) => eq.data),
|
||||||
|
});
|
||||||
|
|
||||||
// Fetch created earthquakes by their unique codes
|
// Fetch created earthquakes by their unique codes
|
||||||
const createdEarthquakes = await tx.earthquake.findMany({
|
const createdEarthquakes = await tx.earthquake.findMany({
|
||||||
where: {
|
where: {
|
||||||
code: { in: validEarthquakes.map((eq) => eq.data.code) },
|
code: { in: validEarthquakes.map((eq) => eq.data.code) },
|
||||||
},
|
},
|
||||||
select: { id: true, code: true },
|
select: { id: true, code: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
// Connect observatories to each earthquake
|
// Connect observatories to each earthquake
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
validEarthquakes.map(async (eq) => {
|
validEarthquakes.map(async (eq) => {
|
||||||
const createdEq = createdEarthquakes.find((ce) => ce.code === eq.data.code);
|
const createdEq = createdEarthquakes.find((ce) => ce.code === eq.data.code);
|
||||||
if (createdEq && eq.observatories.length > 0) {
|
if (createdEq && eq.observatories.length > 0) {
|
||||||
await tx.earthquake.update({
|
await tx.earthquake.update({
|
||||||
where: { id: createdEq.id },
|
where: { id: createdEq.id },
|
||||||
data: {
|
data: {
|
||||||
observatories: { connect: eq.observatories },
|
observatories: { connect: eq.observatories },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
{ timeout: 1000000 }
|
||||||
|
);
|
||||||
|
|
||||||
if (failedImports.length > 0) {
|
if (failedImports.length > 0) {
|
||||||
console.warn("Failed imports:", failedImports);
|
console.warn("Failed imports:", failedImports);
|
||||||
|
|||||||
@ -3,8 +3,8 @@ import { SignJWT } from "jose";
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
import { env } from "@utils/env";
|
import { env } from "@utils/env";
|
||||||
|
|
||||||
import { prisma } from "@utils/prisma";
|
import { prisma } from "@utils/prisma";
|
||||||
|
|
||||||
import { findUserByEmail, readUserCsv, User } from "../functions/csvReadWrite";
|
import { findUserByEmail, readUserCsv, User } from "../functions/csvReadWrite";
|
||||||
|
|
||||||
export async function POST(req: Request) {
|
export async function POST(req: Request) {
|
||||||
@ -29,16 +29,17 @@ export async function POST(req: Request) {
|
|||||||
user = await prisma.user.findUnique({
|
user = await prisma.user.findUnique({
|
||||||
where: { id: user.id },
|
where: { id: user.id },
|
||||||
include: {
|
include: {
|
||||||
|
earthquakes: true,
|
||||||
|
observatories: true,
|
||||||
|
artefacts: true,
|
||||||
|
purchasedOrders: true,
|
||||||
|
requests: true,
|
||||||
scientist: {
|
scientist: {
|
||||||
include: {
|
include: {
|
||||||
earthquakes: true,
|
|
||||||
observatories: true,
|
|
||||||
artefacts: true,
|
|
||||||
superior: true,
|
superior: true,
|
||||||
subordinates: true,
|
subordinates: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
purchasedArtefacts: true,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -2,46 +2,15 @@ import { NextResponse } from "next/server";
|
|||||||
|
|
||||||
import { prisma } from "@utils/prisma";
|
import { prisma } from "@utils/prisma";
|
||||||
|
|
||||||
// todo remove if (usingPrisma) code
|
|
||||||
// todo add specification of date range in request
|
|
||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
try {
|
try {
|
||||||
const events = [
|
|
||||||
{
|
|
||||||
id: "1234",
|
|
||||||
title: "Earthquake - Berlin Observatory",
|
|
||||||
text1: "Logged by ",
|
|
||||||
text2: "30 minutes ago",
|
|
||||||
longitude: 10.4515, // Near Berlin, Germany
|
|
||||||
latitude: 52.52,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "2134",
|
|
||||||
title: "New Observatory - Phuket, Thailand",
|
|
||||||
text1: "Dr. Neil Armstrong",
|
|
||||||
text2: "2 weeks ago",
|
|
||||||
longitude: -122.4194,
|
|
||||||
latitude: 37.7749,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "2314",
|
|
||||||
title: "Observatory Scientist Change",
|
|
||||||
text1: "Dr. Samantha Green new lead scientist",
|
|
||||||
text2: "1 month ago",
|
|
||||||
longitude: 139.6917,
|
|
||||||
latitude: 35.6762,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// todo get earthquakes associated with observatories
|
// todo get earthquakes associated with observatories
|
||||||
const observatories = await prisma.observatory.findMany();
|
const observatories = await prisma.observatory.findMany();
|
||||||
|
|
||||||
if (observatories) {
|
if (observatories) {
|
||||||
return NextResponse.json({ message: "Got observatories successfully", observatories }, { status: 200 });
|
return NextResponse.json({ message: "Got observatories successfully", observatories }, { status: 200 });
|
||||||
} else {
|
} else {
|
||||||
return NextResponse.json({ message: "Got observatories successfully", observatories: events }, { status: 200 });
|
return NextResponse.json({ message: "Failed to get observatories" }, { status: 401 });
|
||||||
// return NextResponse.json({ message: "Failed to get observatories" }, { status: 401 });
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error in observatories endpoint:", error);
|
console.error("Error in observatories endpoint:", error);
|
||||||
|
|||||||
@ -5,13 +5,13 @@ import useSWR from "swr";
|
|||||||
|
|
||||||
import Map from "@components/Map";
|
import Map from "@components/Map";
|
||||||
import Sidebar from "@components/Sidebar";
|
import Sidebar from "@components/Sidebar";
|
||||||
import { fetcher } from "@utils/fetcher";
|
import { createPoster, fetcher } from "@utils/axiosHelpers";
|
||||||
|
|
||||||
export default function Earthquakes() {
|
export default function Earthquakes() {
|
||||||
const [selectedEventId, setSelectedEventId] = useState("");
|
const [selectedEventId, setSelectedEventId] = useState("");
|
||||||
const [hoveredEventId, setHoveredEventId] = useState("");
|
const [hoveredEventId, setHoveredEventId] = useState("");
|
||||||
// todo properly integrate loading
|
// todo properly integrate loading
|
||||||
const { data, error, isLoading } = useSWR("/api/earthquakes", fetcher);
|
const { data, error, isLoading } = useSWR("/api/earthquakes", createPoster({ rangeDaysPrev: 5 }));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex overflow-hidden">
|
<div className="h-full flex overflow-hidden">
|
||||||
@ -38,7 +38,6 @@ export default function Earthquakes() {
|
|||||||
button2Name="Search Earthquakes"
|
button2Name="Search Earthquakes"
|
||||||
></Sidebar>
|
></Sidebar>
|
||||||
{/* <SidebarTest></SidebarTest> */}
|
{/* <SidebarTest></SidebarTest> */}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,92 +1,91 @@
|
|||||||
// app/learn/page.tsx
|
// app/learn/page.tsx
|
||||||
"use client";
|
"use client";
|
||||||
import Navbar from "@/components/Navbar";
|
|
||||||
import BottomFooter from "@components/BottomFooter";
|
import BottomFooter from "@components/BottomFooter";
|
||||||
|
import Navbar from "@components/Navbar";
|
||||||
|
|
||||||
export default function LearnPage() {
|
export default function LearnPage() {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-blue-50 flex flex-col">
|
<div className="min-h-screen bg-blue-50 flex flex-col">
|
||||||
{/* (Optional) Navbar */}
|
{/* (Optional) Navbar */}
|
||||||
{/* <Navbar /> */}
|
{/* <Navbar /> */}
|
||||||
|
|
||||||
<main className="flex-1 flex flex-col items-center justify-start pt-12 px-4">
|
<main className="flex-1 flex flex-col items-center justify-start pt-12 px-4">
|
||||||
<h1 className="text-4xl font-bold mb-4 text-blue-800 text-center">
|
<h1 className="text-4xl font-bold mb-4 text-blue-800 text-center">Earthquakes</h1>
|
||||||
Earthquakes
|
<p className="max-w-2xl text-lg text-gray-700 mb-6 text-center">
|
||||||
</h1>
|
<span className="font-bold">In this page, you can learn all about what earthquakes are, and how to keep safe!</span>
|
||||||
<p className="max-w-2xl text-lg text-gray-700 mb-6 text-center">
|
</p>
|
||||||
<span className="font-bold">In this page, you can learn all about what earthquakes are, and how to keep safe!</span>
|
<div className="max-w-3xl text-base text-gray-600 text-left space-y-8">
|
||||||
</p>
|
{/* Section 1 */}
|
||||||
<div className="max-w-3xl text-base text-gray-600 text-left space-y-8">
|
<section>
|
||||||
|
<p>
|
||||||
|
<span className="font-semibold text-blue-800">What are earthquakes?</span>
|
||||||
|
<br />
|
||||||
|
Earthquakes are a shaking of the earth's surface caused by a sudden release of energy underground. They can range in
|
||||||
|
size, from tiny trembles to large quakes, which can cause destruction and even tsunamis. Hundreds of earthquakes
|
||||||
|
happen every day—but most are too small to feel.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
{/* Section 1 */}
|
{/* Section 2 */}
|
||||||
<section>
|
<section>
|
||||||
<p>
|
<p>
|
||||||
<span className="font-semibold text-blue-800">What are earthquakes?</span>
|
<span className="font-semibold text-blue-800">What are the types of earthquakes?</span>
|
||||||
<br />
|
<br />
|
||||||
Earthquakes are a shaking of the earth's surface caused by a sudden release of energy underground.
|
Regions near plate boundaries, such as around the Pacific Ocean ("The Ring of Fire"), experience the most activity.
|
||||||
They can range in size, from tiny trembles to large quakes, which can cause destruction and even tsunamis.
|
</p>
|
||||||
Hundreds of earthquakes happen every day—but most are too small to feel.
|
</section>
|
||||||
</p>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{/* Section 2 */}
|
{/* Section 3 */}
|
||||||
<section>
|
<section>
|
||||||
<p>
|
<p>
|
||||||
<span className="font-semibold text-blue-800">What are the types of earthquakes?</span>
|
<span className="font-semibold text-blue-800">How can I be prepared?</span>
|
||||||
<br />
|
</p>
|
||||||
Regions near plate boundaries, such as around the Pacific Ocean ("The Ring of Fire"), experience the most activity.
|
{/* MAIN BULLET POINTS */}
|
||||||
</p>
|
<ul className="list-disc list-inside pl-6 space-y-2">
|
||||||
</section>
|
<li>
|
||||||
|
<span className="font-bold text-gray-800">Assemble an emergency kit:</span>
|
||||||
{/* Section 3 */}
|
This should be stored in your earthquake emergency zone. It may be useful, as in an earthquake, you may lose
|
||||||
<section>
|
electricity or water supplies.
|
||||||
<p>
|
{/* SUB BULLETS */}
|
||||||
<span className="font-semibold text-blue-800">How can I be prepared?</span>
|
<ul className="list-disc list-inside pl-6 mt-1 space-y-1 text-gray-700">
|
||||||
</p>
|
<li>First aid kit and emergency medication</li>
|
||||||
{/* MAIN BULLET POINTS */}
|
<li>Food (non-perishable)</li>
|
||||||
<ul className="list-disc list-inside pl-6 space-y-2">
|
<li>Bottled water</li>
|
||||||
<li>
|
<li>Torch (flashlight)</li>
|
||||||
<span className="font-bold text-gray-800">Assemble an emergency kit:</span>
|
<li>Satellite phone</li>
|
||||||
This should be stored in your earthquake emergency zone. It may be useful, as in an earthquake, you may lose electricity or water supplies.
|
<li>Warm clothing and blankets</li>
|
||||||
{/* SUB BULLETS */}
|
</ul>
|
||||||
<ul className="list-disc list-inside pl-6 mt-1 space-y-1 text-gray-700">
|
</li>
|
||||||
<li>First aid kit and emergency medication</li>
|
<li>
|
||||||
<li>Food (non-perishable)</li>
|
<span className="font-bold text-gray-800">Practice the Drop, Cover, and Hold On drill!</span>
|
||||||
<li>Bottled water</li>
|
This helps you protect yourself from falling objects during an earthquake.
|
||||||
<li>Torch (flashlight)</li>
|
{/* Embed YouTube video */}
|
||||||
<li>Satellite phone</li>
|
<div className="mt-2 flex justify-center">
|
||||||
<li>Warm clothing and blankets</li>
|
<iframe
|
||||||
</ul>
|
width="350"
|
||||||
</li>
|
height="200"
|
||||||
<li>
|
className="rounded shadow"
|
||||||
<span className="font-bold text-gray-800">Practice the Drop, Cover, and Hold On drill!</span>
|
src="https://www.youtube.com/embed/-MKMiFWK6Xk"
|
||||||
This helps you protect yourself from falling objects during an earthquake.
|
title="Drop, Cover, and Hold On - Official Earthquake Drill Video"
|
||||||
{/* Embed YouTube video */}
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||||
<div className="mt-2 flex justify-center">
|
allowFullScreen
|
||||||
<iframe
|
/>
|
||||||
width="350"
|
</div>
|
||||||
height="200"
|
</li>
|
||||||
className="rounded shadow"
|
<li>
|
||||||
src="https://www.youtube.com/embed/-MKMiFWK6Xk"
|
<span className="font-bold text-gray-800">Identify a safe zone:</span>
|
||||||
title="Drop, Cover, and Hold On - Official Earthquake Drill Video"
|
This should be a sturdy place where all members of your household can shelter, such as under a strong table, in a
|
||||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
structurally sound room, or your local community’s shared space.
|
||||||
allowFullScreen
|
</li>
|
||||||
/>
|
<li>
|
||||||
</div>
|
<span className="font-bold text-gray-800">Discuss what to do:</span>
|
||||||
</li>
|
Share this information with your family and friends! Talk about what each person would do in an emergency.
|
||||||
<li>
|
</li>
|
||||||
<span className="font-bold text-gray-800">Identify a safe zone:</span>
|
</ul>
|
||||||
This should be a sturdy place where all members of your household can shelter, such as under a strong table, in a structurally sound room, or your local community’s shared space.
|
</section>
|
||||||
</li>
|
</div>
|
||||||
<li>
|
</main>
|
||||||
<span className="font-bold text-gray-800">Discuss what to do:</span>
|
<BottomFooter />
|
||||||
Share this information with your family and friends! Talk about what each person would do in an emergency.
|
</div>
|
||||||
</li>
|
);
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
<BottomFooter />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
@ -5,13 +5,13 @@ import useSWR from "swr";
|
|||||||
|
|
||||||
import Sidebar from "@/components/Sidebar";
|
import Sidebar from "@/components/Sidebar";
|
||||||
import Map from "@components/Map";
|
import Map from "@components/Map";
|
||||||
import { fetcher } from "@utils/fetcher";
|
import { fetcher } from "@utils/axiosHelpers";
|
||||||
|
|
||||||
export default function Observatories() {
|
export default function Observatories() {
|
||||||
const [selectedEventId, setSelectedEventId] = useState("");
|
const [selectedEventId, setSelectedEventId] = useState("");
|
||||||
const [hoveredEventId, setHoveredEventId] = useState("");
|
const [hoveredEventId, setHoveredEventId] = useState("");
|
||||||
// todo properly integrate loading
|
// todo properly integrate loading
|
||||||
const { data, error, isLoading } = useSWR("/api/earthquakes", fetcher);
|
const { data, error, isLoading } = useSWR("/api/observatories", fetcher);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex overflow-hidden">
|
<div className="h-full flex overflow-hidden">
|
||||||
|
|||||||
7
src/utils/axiosHelpers.ts
Normal file
7
src/utils/axiosHelpers.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
export const fetcher = (url: string) => axios.get(url).then((res) => res.data);
|
||||||
|
|
||||||
|
export function createPoster(data: object) {
|
||||||
|
return (url: string) => axios.post(url, data).then((res) => res.data);
|
||||||
|
}
|
||||||
16
src/utils/countRows.ts
Normal file
16
src/utils/countRows.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { PrismaClient } from "../generated/prisma/client";
|
||||||
|
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
|
async function countRows() {
|
||||||
|
try {
|
||||||
|
const count = await prisma.earthquake.count();
|
||||||
|
console.log(`Row count: ${count}`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error:", error);
|
||||||
|
} finally {
|
||||||
|
await prisma.$disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
countRows();
|
||||||
@ -1,3 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
|
|
||||||
export const fetcher = (url: string) => axios.get(url).then((res) => res.data);
|
|
||||||
Loading…
x
Reference in New Issue
Block a user