feat: add custom stickers
This commit is contained in:
+15
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user