Skip to content

Commit c4d0544

Browse files
committed
feat: add remoteSessionCheck to the updateAsset API
1 parent fb8e986 commit c4d0544

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/backend/asset.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,20 @@ export default (apiUrl: string) => ({
3131
authToken: string,
3232
memoriID?: string,
3333
memoryID?: string,
34-
isRemoteSession?: boolean
3534
) => {
36-
const data = new FormData() ;
35+
const data = new FormData();
3736
const file = await fetch(fileUrl);
3837
const fileBlob = await file.blob();
3938

4039
data.append(fileName, fileBlob, fileName);
4140

42-
data.append('remoteSessionCheck', isRemoteSession?.toString() ?? 'false');
43-
4441
const upload = await fetch(
4542
`${apiUrl}/Asset/${authToken}${memoriID ? `/${memoriID}` : ''}${
4643
memoryID ? `/${memoryID}` : ''
4744
}`,
4845
{
4946
method: 'POST',
50-
body: data
47+
body: data,
5148
}
5249
);
5350
return (await upload.json()) as Promise<
@@ -120,11 +117,14 @@ export default (apiUrl: string) => ({
120117
* @param {string} assetURL - The asset URL
121118
* @returns The updated asset object
122119
*/
123-
updateAsset: (authToken: string, assetURL: string, asset: Asset) =>
120+
updateAsset: (authToken: string, assetURL: string, asset: Asset, remoteSessionCheck?: boolean) =>
124121
apiFetcher(`/Asset/${authToken}/${assetURL.split('/').reverse()[0]}`, {
125122
apiUrl,
126123
method: 'PATCH',
127-
body: asset,
124+
body: {
125+
...asset,
126+
remoteSessionCheck: remoteSessionCheck ?? false,
127+
},
128128
}) as Promise<ResponseSpec & { asset: Asset }>,
129129

130130
/**

0 commit comments

Comments
 (0)