22
33namespace Appwrite \Platform \Modules \Project \Http \Project \Services \Status ;
44
5+ use Appwrite \Event \Event ;
56use Appwrite \Platform \Action ;
67use Appwrite \SDK \AuthType ;
78use Appwrite \SDK \Method ;
@@ -33,8 +34,8 @@ public function __construct()
3334 ->desc ('Update project service status ' )
3435 ->groups (['api ' , 'project ' ])
3536 ->label ('scope ' , 'project.write ' )
36- ->label ('event ' , 'services.[service ].update ' )
37- ->label ('audits.event ' , 'project.services.[service ].update ' )
37+ ->label ('event ' , 'services.[serviceId ].update ' )
38+ ->label ('audits.event ' , 'project.services.[serviceId ].update ' )
3839 ->label ('audits.resource ' , 'project.services/{response.$id} ' )
3940 ->label ('sdk ' , new Method (
4041 namespace: 'project ' ,
@@ -57,6 +58,7 @@ public function __construct()
5758 ->inject ('dbForPlatform ' )
5859 ->inject ('project ' )
5960 ->inject ('authorization ' )
61+ ->inject ('queueForEvents ' )
6062 ->callback ($ this ->action (...));
6163 }
6264
@@ -66,7 +68,8 @@ public function action(
6668 Response $ response ,
6769 Database $ dbForPlatform ,
6870 Document $ project ,
69- Authorization $ authorization
71+ Authorization $ authorization ,
72+ Event $ queueForEvents
7073 ): void {
7174 $ services = $ project ->getAttribute ('services ' , []);
7275 $ services [$ serviceId ] = $ enabled ;
@@ -75,6 +78,8 @@ public function action(
7578 'services ' => $ services ,
7679 ])));
7780
81+ $ queueForEvents ->setParam ('serviceId ' , $ serviceId );
82+
7883 $ response ->dynamic ($ project , Response::MODEL_PROJECT );
7984 }
8085}
0 commit comments