Spaces:
Paused
Paused
Commit
β’
73cc2a0
1
Parent(s):
d9e9849
try to force-refresh
Browse files- src/server/actions.ts +0 -2
- src/server/index.ts +6 -0
src/server/actions.ts
CHANGED
@@ -8,8 +8,6 @@ export async function handleFormSubmit(formData: FormData) {
|
|
8 |
await createNewVideo(ownerId, {
|
9 |
prompt: `${formData.get("prompt") || ""}`,
|
10 |
})
|
11 |
-
// for doc see https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions
|
12 |
-
revalidatePath(`/studio/${ownerId}`)
|
13 |
}
|
14 |
|
15 |
export async function refreshStudio(ownerId: string) {
|
|
|
8 |
await createNewVideo(ownerId, {
|
9 |
prompt: `${formData.get("prompt") || ""}`,
|
10 |
})
|
|
|
|
|
11 |
}
|
12 |
|
13 |
export async function refreshStudio(ownerId: string) {
|
src/server/index.ts
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
"use server"
|
2 |
|
|
|
|
|
3 |
import { Video, VideoAPIRequest, GenericAPIResponse, VideoStatusRequest, VideoStatus } from "@/app/types"
|
4 |
|
5 |
import { GET, POST, DELETE, PATCH } from "./base"
|
@@ -31,6 +33,8 @@ export const getVideo = async (ownerId: string, videoId: string) => {
|
|
31 |
export const setVideoStatus = async (ownerId: string, videoId: string, status: VideoStatus) => {
|
32 |
const task = await PATCH<VideoStatusRequest, GenericAPIResponse>(`${ownerId}/${videoId}`, { status }, null as unknown as Video)
|
33 |
|
|
|
|
|
34 |
return task
|
35 |
}
|
36 |
|
@@ -57,6 +61,8 @@ export const createNewVideo = async (ownerId: string, taskRequest: VideoAPIReque
|
|
57 |
null as unknown as Video
|
58 |
)
|
59 |
|
|
|
|
|
60 |
return task
|
61 |
}
|
62 |
|
|
|
1 |
"use server"
|
2 |
|
3 |
+
import { revalidatePath } from "next/cache"
|
4 |
+
|
5 |
import { Video, VideoAPIRequest, GenericAPIResponse, VideoStatusRequest, VideoStatus } from "@/app/types"
|
6 |
|
7 |
import { GET, POST, DELETE, PATCH } from "./base"
|
|
|
33 |
export const setVideoStatus = async (ownerId: string, videoId: string, status: VideoStatus) => {
|
34 |
const task = await PATCH<VideoStatusRequest, GenericAPIResponse>(`${ownerId}/${videoId}`, { status }, null as unknown as Video)
|
35 |
|
36 |
+
revalidatePath(`/studio/${ownerId}`)
|
37 |
+
|
38 |
return task
|
39 |
}
|
40 |
|
|
|
61 |
null as unknown as Video
|
62 |
)
|
63 |
|
64 |
+
// for doc see https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions
|
65 |
+
revalidatePath(`/studio/${ownerId}`)
|
66 |
return task
|
67 |
}
|
68 |
|