Initial ASPHP website

This commit is contained in:
Codex
2026-09-06 00:14:09 +03:30
commit ff6d5a3c0c
65 changed files with 14617 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import { NextResponse } from "next/server";
import { getCurrentUser } from "../../meshkee";
export async function GET(request) {
const token = request.headers.get("authorization")?.replace(/^Bearer\s+/i, "");
if (!token) return NextResponse.json({ message: "Missing token" }, { status: 401 });
try {
const data = await getCurrentUser(token);
return NextResponse.json(data);
} catch {
return NextResponse.json({ message: "Could not load user" }, { status: 401 });
}
}
+20
View File
@@ -0,0 +1,20 @@
import { NextResponse } from "next/server";
import { addCartItem } from "../../../meshkee";
export async function POST(request) {
const token = request.headers.get("authorization")?.replace(/^Bearer\s+/i, "");
if (!token) return NextResponse.json({ message: "Missing token" }, { status: 401 });
try {
const body = await request.json();
const data = await addCartItem({
businessId: body.businessId,
token,
storeItemVariantId: body.storeItemVariantId,
quantity: body.quantity || 1
});
return NextResponse.json(data, { status: 201 });
} catch {
return NextResponse.json({ message: "Could not add cart item" }, { status: 502 });
}
}
+18
View File
@@ -0,0 +1,18 @@
import { NextResponse } from "next/server";
import { submitContact } from "../../meshkee";
export async function POST(request) {
try {
const body = await request.json();
const data = await submitContact({
title: body.title,
name: body.name,
cellNumber: body.cellNumber,
email: body.email,
text: body.text
});
return NextResponse.json(data, { status: 201 });
} catch (error) {
return NextResponse.json({ message: "Contact submission failed" }, { status: 502 });
}
}