Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

Commit 49e7c5c

Browse files
committed
fix inviteFile
1 parent ffd9428 commit 49e7c5c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Api.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,16 @@ public function allFiles(string $bucket): iterable
285285
/**
286286
* @param string $bucket
287287
* @param string $route
288-
* @param int $timestamp
288+
* @param \DateTime $dateTime
289289
* @param array $options
290290
* @return array
291291
*/
292-
public function inviteFile(string $bucket, string $route, int $timestamp, array $options): array
292+
public function inviteFile(string $bucket, string $route, \DateTime $dateTime, array $options): array
293293
{
294294
return $this->client->safePost(
295-
\sprintf('/api/bucket/%s/invite/%d', $bucket, $route),
296-
\array_merge($options, ['expire' => $timestamp]),
297-
)['data'] ?? [];
295+
\sprintf('/api/bucket/%s/invite/%d', $bucket, $route),
296+
\array_merge($options, ['expires_at' => $dateTime->format('Y-m-d H:i:s')]),
297+
)['data'] ?? [];
298298
}
299299

300300
}

src/Interfaces/Invitable.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ interface Invitable
77
/**
88
* @param string $bucket
99
* @param string $route
10-
* @param int $timestamp
10+
* @param \DateTime $dateTime
1111
* @param array $options
1212
* @return array
1313
*/
14-
public function inviteFile(string $bucket, string $route, int $timestamp, array $options): array;
14+
public function inviteFile(string $bucket, string $route, \DateTime $dateTime, array $options): array;
1515
}

0 commit comments

Comments
 (0)