mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-25 16:05:27 +03:00
29 lines
552 B
TypeScript
29 lines
552 B
TypeScript
import { Poke, Serial } from "../lib";
|
|
import { InviteUpdate, InviteUpdateAccept, InviteUpdateDecline } from "./types";
|
|
|
|
export const inviteAction = <T extends InviteUpdate>(data: T): Poke<T> => ({
|
|
app: 'invite-store',
|
|
mark: 'invite-action',
|
|
json: data
|
|
});
|
|
|
|
export const accept = (
|
|
app: string,
|
|
uid: Serial
|
|
): Poke<InviteUpdateAccept> => inviteAction({
|
|
accept: {
|
|
term: app,
|
|
uid
|
|
}
|
|
});
|
|
|
|
export const decline = (
|
|
app: string,
|
|
uid: Serial
|
|
): Poke<InviteUpdateDecline> => inviteAction({
|
|
decline: {
|
|
term: app,
|
|
uid
|
|
}
|
|
});
|