File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments