1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { set } from "https://esm.town/v/std/set?v=11";
import { reservationRequests } from "https://esm.town/v/alp/reservationRequests";
export const addResyReservationRequest = async (request: {
reservation: {
date: string;
seats: number;
timeRange: [
string,
string,
];
};
auth: {
email: string;
password: string;
};
// https://resy.com/cities/ny/venues/rule-of-thirds
// ^ venue city ^ venue slug
venue: {
// e.g. rule-of-thirds
slug: string;
// e.g. ny
city: string;
};
}) => {
reservationRequests.push(request);
await set(
"reservationRequests",
reservationRequests,
);
};
๐Ÿ‘† This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data โ€” all from the browser.