upload test passing + file not getting deleted every time - well it is but we now use a copy lol
This commit is contained in:
@@ -56,6 +56,13 @@ class ProductPhotosController extends AppController
|
||||
$productPhotosTable = $this->getTable();
|
||||
$productPhoto = $productPhotosTable->newEmptyEntity();
|
||||
if ($this->request->is('post')) {
|
||||
if (!$this->request->getData('photo')) {
|
||||
$this->Flash->error('Photo is required. Nothing was uploaded. Please try again.');
|
||||
$products = $productPhotosTable->Products->find('list', limit: 200)->all();
|
||||
$this->set(compact('productPhoto', 'products'));
|
||||
|
||||
return;
|
||||
}
|
||||
$uuid = Text::uuid();
|
||||
$postData = $this->request->getData();
|
||||
$postData['id'] = $uuid;
|
||||
|
||||
Reference in New Issue
Block a user