mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
wip: events compat based on version.
This commit is contained in:
parent
75c9db8031
commit
37fb34ae12
1 changed files with 19 additions and 3 deletions
|
|
@ -483,10 +483,26 @@ App::init()
|
|||
/*
|
||||
* Background Jobs
|
||||
*/
|
||||
$events = $route->getLabel('event', '');
|
||||
$queueForEvents
|
||||
->setEvent($route->getLabel('event', ''))
|
||||
->setProject($project)
|
||||
->setUser($user);
|
||||
->setUser($user)
|
||||
->setEvent($events)
|
||||
->setProject($project);
|
||||
|
||||
if (str_contains($events, '.tables.')) {
|
||||
$requestFormat = $request->getHeader('x-appwrite-response-format', System::getEnv('_APP_SYSTEM_RESPONSE_FORMAT', ''));
|
||||
if ($requestFormat && version_compare($requestFormat, '1.7.0', '<')) {
|
||||
$map = [
|
||||
'rows' => 'documents',
|
||||
'tables' => 'collections',
|
||||
'columns' => 'attributes',
|
||||
];
|
||||
|
||||
$compatibleEvents = str_replace(array_keys($map), array_values($map), $events);
|
||||
// override the events
|
||||
$queueForEvents->setEvent($compatibleEvents);
|
||||
}
|
||||
}
|
||||
|
||||
$queueForAudits
|
||||
->setMode($mode)
|
||||
|
|
|
|||
Loading…
Reference in a new issue