Skip to content

Commit 1b55748

Browse files
committed
PATCH KHSDFJDSHFJKSDHJK
1 parent c77b080 commit 1b55748

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pages/api/records.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,21 @@ export default async(req: NextApiRequest, res: NextApiResponse) => {
4848
if (req.method === "PATCH") {
4949
try {
5050
const checkIn = async (id: string, pod: string) => {
51+
// const oldData = await fetch(`https://api.airtable.com/v0/applfCora9qnm274A/Main/${id}`, {
52+
// method: "GET",
53+
// headers: {
54+
// Authorization: `Bearer ${process.env.AIRTABLE_ACCESS_TOKEN}`,
55+
// }
56+
// }).then((res) => res.json());
5157
const resp = await fetch(`https://api.airtable.com/v0/applfCora9qnm274A/Main/${id}`, {
52-
method: "PUT",
58+
method: "PATCH",
5359
headers: {
5460
Authorization: `Bearer ${process.env.AIRTABLE_ACCESS_TOKEN}`,
5561
"Content-Type": "application/json",
5662
},
5763
body: JSON.stringify({
5864
fields: {
65+
// ...((oldData as any).fields as any),
5966
"Pod": pod,
6067
"Checked In?": true
6168
}
@@ -75,7 +82,7 @@ export default async(req: NextApiRequest, res: NextApiResponse) => {
7582
const status = await checkIn(id, req.body.pod);
7683
if (!status) failed = true;
7784

78-
if (!isLast) await sleep(220);
85+
if (!isLast) await sleep(420);
7986
}
8087

8188
if (!failed) {

0 commit comments

Comments
 (0)