Fixed /rest/media endpoint DELETE

This commit is contained in:
Albert Santoni 2015-03-03 12:52:41 -05:00
parent 0144fd2a84
commit 8a6ee8ad14
1 changed files with 2 additions and 4 deletions

View File

@ -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();
} }