@@ -316,7 +316,7 @@ public function add($templateName, $templateFile) {
316316 $ template = $ folder ->newFile ($ templateName );
317317 }
318318 $ template ->putContent ($ templateFile );
319-
319+ $ folder -> getStorage ()-> getCache ()-> update ( $ folder -> getId (), [ ' etag ' => uniqid () ]);
320320 return $ this ->formatNodeReturn ($ this ->get ($ template ->getId ()));
321321 }
322322
@@ -327,11 +327,13 @@ public function add($templateName, $templateFile) {
327327 * @return boolean
328328 * @throws NotFoundException
329329 */
330- public function delete ($ fileId ) {
331- $ files = $ this ->getSystemTemplateDir ()->getDirectoryListing ();
330+ public function delete ($ fileId ): bool {
331+ $ folder = $ this ->getSystemTemplateDir ();
332+ $ files = $ folder ->getDirectoryListing ();
332333 foreach ($ files as $ file ) {
333334 if ($ file ->getId () === $ fileId ) {
334335 $ file ->delete ();
336+ $ folder ->getStorage ()->getCache ()->update ($ folder ->getId (), [ 'etag ' => uniqid () ]);
335337 return true ;
336338 }
337339 }
@@ -389,7 +391,7 @@ public function getUserTemplateDir() {
389391 /**
390392 * @return Folder
391393 */
392- private function getSystemTemplateDir () {
394+ public function getSystemTemplateDir () {
393395 $ this ->ensureAppDataFolders ();
394396 $ path = 'appdata_ ' . $ this ->config ->getSystemValue ('instanceid ' , null ) . '/richdocuments/templates ' ;
395397 return $ this ->rootFolder ->get ($ path );
0 commit comments