mirror of
https://github.com/appwrite/appwrite
synced 2026-05-06 06:48:22 +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();
|
||||
|
||||
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(
|
||||
Document $project,
|
||||
Document $migration,
|
||||
Mail $queueForMails
|
||||
Mail $queueForMails,
|
||||
Realtime $queueForRealtime,
|
||||
): void {
|
||||
$options = $migration->getAttribute('options', []);
|
||||
$bucketId = 'default'; // Always use platform default bucket
|
||||
|
|
@ -530,6 +531,9 @@ class Migrations extends Action
|
|||
$endpoint = System::getEnv('_APP_DOMAIN', '');
|
||||
$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}";
|
||||
$options['downloadUrl'] = $downloadUrl;
|
||||
$migration->setAttribute('options', $options);
|
||||
$this->updateMigrationDocument($migration, $project, $queueForRealtime);
|
||||
|
||||
$this->sendCSVEmail(
|
||||
success: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue