feat: whole shops listed on IMVU, and GET /imports/available (#16)
Co-authored-by: dhkatz <[email protected]>
This commit was merged in pull request #16.
This commit is contained in:
1 parent
8f6dacba10
commit
efc7d6b808
15 files changed
+4954
-20
No files matched your search
@@ -156,7 +156,19 @@ export async function decideGrant(_: ActionState, form: FormData): Promise<Actio
|
||||
.grants({ id: grant })({ decision })
|
||||
.post(reason ? { reason } : {}),
|
||||
);
|
||||
return decision === "accept" ? `Accepted. ${r.queued} queued for the importer.` : "Declined.";
|
||||
if (decision !== "accept") return "Declined.";
|
||||
return r.grant.scope === "shop"
|
||||
? `Accepted. ${r.queued} queued for the importer; the shop's other products follow once it's listed on IMVU.`
|
||||
: `Accepted. ${r.queued} queued for the importer.`;
|
||||
});
|
||||
}
|
||||
|
||||
/** Lists a whole-shop grant's products on IMVU again (new ones are queued). */
|
||||
export async function listShop(_: ActionState, form: FormData): Promise<ActionState> {
|
||||
return onCatalog(form, async (id) => {
|
||||
revalidatePath(`/console/catalogs/${id}/imports`);
|
||||
const r = unwrap(await api.imports.grants({ id: field(form, "grant") }).list.post());
|
||||
return `${r.listed} product${r.listed === 1 ? "" : "s"} on IMVU; ${r.queued} new queued.`;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user