Skip to content

Commit 01953e5

Browse files
mbreithuMartin Breithuber
andauthored
Add typecast to upsert method params (#89)
* add typecast to upsert method params * throw on errors --------- Co-authored-by: Martin Breithuber <martinbreithuber@Martins-MacBook-WTD.local>
1 parent 0e96819 commit 01953e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Api/AirtableApiClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private function buildClient($access_token)
4646
'Authorization' => "Bearer {$access_token}",
4747
'content-type' => 'application/json',
4848
],
49-
]);
49+
])->throw();
5050
}
5151

5252
public function addFilter($column, $operation, $value): AirtableApiClient
@@ -187,7 +187,7 @@ public function upsert($data = null, $fieldsToMergeOn = [])
187187
];
188188
}
189189

190-
$params = ['performUpsert' => (object) ['fieldsToMergeOn' => $fieldsToMergeOn], 'records' => $contents];
190+
$params = ['performUpsert' => (object) ['fieldsToMergeOn' => $fieldsToMergeOn], 'records' => $contents, 'typecast' => $this->typecast];
191191

192192
$responseData = $this->decodeResponse(
193193
$this->client->patch($this->getEndpointUrl(), $params)

0 commit comments

Comments
 (0)