fix: make ebay refresh action callable from admin API

This commit is contained in:
DMleadgen 2026-04-10 16:08:05 -06:00
parent 5b6ad66c24
commit bcc39664de
Signed by: matt
GPG key ID: C2720CF8CD701894
2 changed files with 3 additions and 16 deletions

View file

@ -10,7 +10,7 @@ export async function POST(request: Request) {
} }
try { try {
const result = await fetchAction(api.ebay.refreshCacheAdmin, { const result = await fetchAction(api.ebay.refreshCache, {
reason: "admin", reason: "admin",
force: true, force: true,
}) })

View file

@ -1,5 +1,5 @@
// @ts-nocheck // @ts-nocheck
import { action, internalAction, internalMutation, query } from "./_generated/server" import { action, internalMutation, query } from "./_generated/server"
import { api, internal } from "./_generated/api" import { api, internal } from "./_generated/api"
import { v } from "convex/values" import { v } from "convex/values"
@ -377,7 +377,7 @@ export const listCachedListings = query({
}, },
}) })
export const refreshCache = internalAction({ export const refreshCache = action({
args: { args: {
reason: v.optional(v.string()), reason: v.optional(v.string()),
force: v.optional(v.boolean()), 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({ export const upsertPollResult = internalMutation({
args: { args: {
key: v.string(), key: v.string(),