shrub/pkg/npm/api/invite/index.ts
2021-02-17 12:23:49 +10:00

29 lines
532 B
TypeScript

import { InviteUpdate, InviteUpdateAccept, InviteUpdateDecline } from "./index.d";
import { Poke, Serial } from "..";
export const action = <T extends InviteUpdate>(data: T): Poke<T> => ({
app: 'invite-store',
mark: 'invite-action',
json: data
});
export const accept = (
app: string,
uid: Serial
): Poke<InviteUpdateAccept> => action({
accept: {
term: app,
uid
}
});
export const decline = (
app: string,
uid: Serial
): Poke<InviteUpdateDecline> => action({
decline: {
term: app,
uid
}
});