mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #10847 from appwrite/feat-csv-export
Set downloadUrl on realtime event
This commit is contained in:
commit
0cdabbf959
1 changed files with 6 additions and 2 deletions
|
|
@ -411,7 +411,7 @@ class Migrations extends Action
|
||||||
$source?->success();
|
$source?->success();
|
||||||
|
|
||||||
if ($migration->getAttribute('destination') === DestinationCSV::getName()) {
|
if ($migration->getAttribute('destination') === DestinationCSV::getName()) {
|
||||||
$this->handleCSVExportComplete($project, $migration, $queueForMails);
|
$this->handleCSVExportComplete($project, $migration, $queueForMails, $queueForRealtime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -432,7 +432,8 @@ class Migrations extends Action
|
||||||
protected function handleCSVExportComplete(
|
protected function handleCSVExportComplete(
|
||||||
Document $project,
|
Document $project,
|
||||||
Document $migration,
|
Document $migration,
|
||||||
Mail $queueForMails
|
Mail $queueForMails,
|
||||||
|
Realtime $queueForRealtime,
|
||||||
): void {
|
): void {
|
||||||
$options = $migration->getAttribute('options', []);
|
$options = $migration->getAttribute('options', []);
|
||||||
$bucketId = 'default'; // Always use platform default bucket
|
$bucketId = 'default'; // Always use platform default bucket
|
||||||
|
|
@ -530,6 +531,9 @@ class Migrations extends Action
|
||||||
$endpoint = System::getEnv('_APP_DOMAIN', '');
|
$endpoint = System::getEnv('_APP_DOMAIN', '');
|
||||||
$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled' ? 'https' : 'http';
|
$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS', 'disabled') === 'enabled' ? 'https' : 'http';
|
||||||
$downloadUrl = "{$protocol}://{$endpoint}/v1/storage/buckets/{$bucketId}/files/{$fileId}/push?project={$project->getId()}&jwt={$jwt}";
|
$downloadUrl = "{$protocol}://{$endpoint}/v1/storage/buckets/{$bucketId}/files/{$fileId}/push?project={$project->getId()}&jwt={$jwt}";
|
||||||
|
$options['downloadUrl'] = $downloadUrl;
|
||||||
|
$migration->setAttribute('options', $options);
|
||||||
|
$this->updateMigrationDocument($migration, $project, $queueForRealtime);
|
||||||
|
|
||||||
$this->sendCSVEmail(
|
$this->sendCSVEmail(
|
||||||
success: true,
|
success: true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue