Fixed /rest/media endpoint DELETE
This commit is contained in:
parent
0144fd2a84
commit
8a6ee8ad14
|
@ -280,10 +280,8 @@ class CcFiles extends BaseCcFiles {
|
||||||
$file = CcFilesQuery::create()->findPk($id);
|
$file = CcFilesQuery::create()->findPk($id);
|
||||||
if ($file) {
|
if ($file) {
|
||||||
$con = Propel::getConnection();
|
$con = Propel::getConnection();
|
||||||
$storedFile = new Application_Model_StoredFile($file, $con);
|
$storedFile = Application_Model_StoredFile::RecallById($id, $con);
|
||||||
if ($storedFile->existsOnDisk()) {
|
$storedFile->delete();
|
||||||
$storedFile->delete(); //TODO: This checks your session permissions... Make it work without a session?
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
throw new FileNotFoundException();
|
throw new FileNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue