upload test passing + file not getting deleted every time - well it is but we now use a copy lol

This commit is contained in:
2025-08-10 02:50:22 -07:00
parent a1012b4054
commit 3a47f09e8c
4 changed files with 19 additions and 2 deletions

View File

@@ -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;