fix: make ebay refresh action callable from admin API
This commit is contained in:
parent
5b6ad66c24
commit
bcc39664de
2 changed files with 3 additions and 16 deletions
|
|
@ -10,7 +10,7 @@ export async function POST(request: Request) {
|
|||
}
|
||||
|
||||
try {
|
||||
const result = await fetchAction(api.ebay.refreshCacheAdmin, {
|
||||
const result = await fetchAction(api.ebay.refreshCache, {
|
||||
reason: "admin",
|
||||
force: true,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// @ts-nocheck
|
||||
import { action, internalAction, internalMutation, query } from "./_generated/server"
|
||||
import { action, internalMutation, query } from "./_generated/server"
|
||||
import { api, internal } from "./_generated/api"
|
||||
import { v } from "convex/values"
|
||||
|
||||
|
|
@ -377,7 +377,7 @@ export const listCachedListings = query({
|
|||
},
|
||||
})
|
||||
|
||||
export const refreshCache = internalAction({
|
||||
export const refreshCache = action({
|
||||
args: {
|
||||
reason: v.optional(v.string()),
|
||||
force: v.optional(v.boolean()),
|
||||
|
|
@ -531,19 +531,6 @@ export const refreshCache = internalAction({
|
|||
},
|
||||
})
|
||||
|
||||
export const refreshCacheAdmin = action({
|
||||
args: {
|
||||
reason: v.optional(v.string()),
|
||||
force: v.optional(v.boolean()),
|
||||
},
|
||||
handler: async (ctx, args) => {
|
||||
return await ctx.runAction(internal.ebay.refreshCache, {
|
||||
reason: args.reason,
|
||||
force: args.force,
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
export const upsertPollResult = internalMutation({
|
||||
args: {
|
||||
key: v.string(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue