feat: add custom stickers

This commit is contained in:
gosangam
2026-08-30 03:03:00 +05:30
parent e0294d80e3
commit f295f59d0b
4 changed files with 349 additions and 3 deletions
+15
View File
@@ -451,6 +451,21 @@ export type GiftableReward = {
export const rewardGifts = {
catalog: () => call<GiftableReward[]>("/admin/reward-gifts/catalog").then((r) => r.data),
/** Presign artwork for a custom gift. Returns the final public URL too,
* since sadhna_rewards.image_url stores an absolute address. */
presignImage: (contentType: string) =>
call<{ upload_url: string; image_url: string }>(
"/admin/reward-gifts/image-presign",
{ method: "POST", body: JSON.stringify({ content_type: contentType }) },
).then((r) => r.data),
/** Add a sticker to the catalog. It reaches nobody until it is sent. */
create: (input: { name: string; meaning: string; image_url: string }) =>
call<GiftableReward>("/admin/reward-gifts/catalog", {
method: "POST",
body: JSON.stringify(input),
}).then((r) => r.data),
/** Hand a reward to every account, unopened. Idempotent — a repeat only
* reaches people who don't already have it. */
send: (rewardKey: string) =>