Skip to content

Commit d221aa4

Browse files
committed
wip
1 parent 7879192 commit d221aa4

4 files changed

Lines changed: 12 additions & 47 deletions

File tree

.github/workflows/playwright.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: shivammathur/setup-php@v2
3939
with:
4040
php-version: '8.4'
41-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
41+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_sqlite, pdo_pgsql, bcmath, soap, intl, gd, exif, iconv
4242
coverage: none
4343

4444
- name: "Run composer install"
@@ -47,6 +47,10 @@ jobs:
4747
- name: "Prepare Laravel Application"
4848
run: |
4949
cp .env.ci .env
50+
echo "DB_HOST=127.0.0.1" >> .env
51+
echo "DB_READ_HOST=127.0.0.1" >> .env
52+
echo "DB_WRITE_HOST=127.0.0.1" >> .env
53+
sleep 10
5054
php artisan key:generate
5155
php artisan passport:keys
5256
php artisan migrate --seed

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

app/Http/Controllers/Api/V1/ClientController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,16 @@ public function update(Organization $organization, Client $client, ClientUpdateR
103103
*/
104104
public function destroy(Organization $organization, Client $client): JsonResponse
105105
{
106-
return response()->json(null, 204);
107-
108106
$this->checkPermission($organization, 'clients:delete', $client);
109107

108+
return response()->json(null, 204);
109+
110110
if ($client->projects()->exists()) {
111111
throw new EntityStillInUseApiException('client', 'project');
112112
}
113113

114114
$client->delete();
115115

116+
return response()->json(null, 204);
116117
}
117118
}

app/Http/Controllers/Api/V1/ProjectController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class ProjectController extends Controller
2727
protected function checkPermission(Organization $organization, string $permission, ?Project $project = null): void
2828
{
2929
parent::checkPermission($organization, $permission);
30+
3031
if ($project !== null && $project->organization_id !== $organization->id) {
3132
throw new AuthorizationException('Project does not belong to organization');
3233
}
@@ -165,8 +166,6 @@ public function update(Organization $organization, Project $project, ProjectUpda
165166
*/
166167
public function destroy(Organization $organization, Project $project): JsonResponse
167168
{
168-
return response()->json(null, 204);
169-
170169
$this->checkPermission($organization, 'projects:delete', $project);
171170

172171
if ($project->tasks()->exists()) {
@@ -176,12 +175,15 @@ public function destroy(Organization $organization, Project $project): JsonRespo
176175
throw new EntityStillInUseApiException('project', 'time_entry');
177176
}
178177

178+
return response()->json(null, 204);
179+
179180
DB::transaction(function () use (&$project): void {
180181
$project->members->each(function (ProjectMember $member): void {
181182
$member->delete();
182183
});
183184
$project->delete();
184185
});
185186

187+
return response()->json(null, 204);
186188
}
187189
}

0 commit comments

Comments
 (0)