@@ -135,6 +135,30 @@ public function updateCardOnRemote(
135135 return $ this ->proxy ->getOcsData ($ resp );
136136 }
137137
138+ public function assignLabelOnRemote (Board $ localBoard , int $ cardId , int $ labelId ): array {
139+ $ this ->configService ->ensureFederationEnabled ();
140+ $ this ->permissionService ->checkPermission ($ this ->boardMapper , $ localBoard ->getId (), Acl::PERMISSION_EDIT , $ this ->userId , false , false );
141+ $ shareToken = $ localBoard ->getShareToken ();
142+ $ ownerCloudId = $ this ->cloudIdManager ->resolveCloudId ($ localBoard ->getOwner ());
143+ $ url = $ ownerCloudId ->getRemote () . '/ocs/v2.php/apps/deck/api/v1.0/cards/ ' . $ cardId . '/label/ ' . $ labelId ;
144+ $ resp = $ this ->proxy ->post ($ ownerCloudId ->getId (), $ shareToken , $ url , [
145+ 'boardId ' => $ localBoard ->getExternalId (),
146+ ]);
147+ return $ this ->proxy ->getOcsData ($ resp );
148+ }
149+
150+ public function removeLabelOnRemote (Board $ localBoard , int $ cardId , int $ labelId ): array {
151+ $ this ->configService ->ensureFederationEnabled ();
152+ $ this ->permissionService ->checkPermission ($ this ->boardMapper , $ localBoard ->getId (), Acl::PERMISSION_EDIT , $ this ->userId , false , false );
153+ $ shareToken = $ localBoard ->getShareToken ();
154+ $ ownerCloudId = $ this ->cloudIdManager ->resolveCloudId ($ localBoard ->getOwner ());
155+ $ url = $ ownerCloudId ->getRemote () . '/ocs/v2.php/apps/deck/api/v1.0/cards/ ' . $ cardId . '/label/ ' . $ labelId ;
156+ $ resp = $ this ->proxy ->delete ($ ownerCloudId ->getId (), $ shareToken , $ url , [
157+ 'boardId ' => $ localBoard ->getExternalId (),
158+ ]);
159+ return $ this ->proxy ->getOcsData ($ resp );
160+ }
161+
138162 public function createStackOnRemote (
139163 Board $ localBoard ,
140164 string $ title ,
0 commit comments