Initial role user app
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { proxyBackendJson } from "@/lib/backend";
|
||||
import type { AnnouncementDetail } from "@/lib/types";
|
||||
|
||||
type Params = {
|
||||
params: Promise<{ id: string }>;
|
||||
};
|
||||
|
||||
export async function POST(_request: Request, { params }: Params) {
|
||||
const { id } = await params;
|
||||
return proxyBackendJson<AnnouncementDetail>(`/mobile/announcements/${encodeURIComponent(id)}/read`, {
|
||||
method: "POST"
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { proxyBackendJson } from "@/lib/backend";
|
||||
import type { AnnouncementDetail } from "@/lib/types";
|
||||
|
||||
type Params = {
|
||||
params: Promise<{ id: string }>;
|
||||
};
|
||||
|
||||
export async function GET(_request: Request, { params }: Params) {
|
||||
const { id } = await params;
|
||||
return proxyBackendJson<AnnouncementDetail>(`/mobile/announcements/${encodeURIComponent(id)}`);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { proxyBackendJson } from "@/lib/backend";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const search = new URL(request.url).search;
|
||||
return proxyBackendJson<unknown>(`/mobile/announcements${search}`);
|
||||
}
|
||||
Reference in New Issue
Block a user