Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ランキングページのキャッシュを修正 #78

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/src/app/api/minio/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import type { IncomingMessage } from "node:http";
import { Readable } from "node:stream";
import { generateCaption } from "@/functions/gpt";
Expand All @@ -7,6 +9,7 @@ import { postSimilarity } from "@/functions/simirality";
import { prisma } from "@/lib/prisma";
import type { ScoreData, ScoreResponse } from "@/types";
import { Client } from "minio";
import { revalidatePath } from "next/cache";
import type { NextRequest } from "next/server";

const minioClient = new Client({
Expand Down Expand Up @@ -122,6 +125,8 @@ export async function POST(req: NextRequest) {
assignmentId: assignmentId,
};

revalidatePath("/ranking");

return new Response(JSON.stringify(response), {
status: 200,
headers: { "Content-Type": "application/json" },
Expand Down
6 changes: 5 additions & 1 deletion app/src/app/api/user/rename/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"use server";

import { prisma } from "@lib/prisma";
import { revalidatePath } from "next/cache";
import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";


export async function PUT(req: NextRequest) {
const { pathname } = new URL(req.url || "");
const id = Number(pathname.split("/").pop());
Expand All @@ -28,6 +30,8 @@ export async function PUT(req: NextRequest) {
data: { name : name },
});

revalidatePath("/ranking");

return NextResponse.json({ putName }, { status: 200 });
} catch (error) {
return NextResponse.json(
Expand Down
Loading