Skip to content

Commit 5a09947

Browse files
committed
wip
1 parent d221aa4 commit 5a09947

24 files changed

Lines changed: 22 additions & 1147 deletions

CONTRIBUTING.md

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

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

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

110-
if ($client->projects()->exists()) {
111-
throw new EntityStillInUseApiException('client', 'project');
112-
}
108+
// $this->checkPermission($organization, 'clients:delete', $client);
113109

114-
$client->delete();
110+
// if ($client->projects()->exists()) {
111+
// throw new EntityStillInUseApiException('client', 'project');
112+
// }
115113

116-
return response()->json(null, 204);
114+
// $client->delete();
115+
116+
// return response()->json(null, 204);
117117
}
118118
}

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@
77
use App\Enums\Role;
88
use App\Http\Requests\V1\Organization\OrganizationUpdateRequest;
99
use App\Http\Resources\V1\Organization\OrganizationResource;
10-
use App\Models\Client;
11-
use App\Models\Member;
1210
use App\Models\Organization;
13-
use App\Models\Project;
14-
use App\Models\Tag;
1511
use App\Service\BillableRateService;
1612
use Illuminate\Auth\Access\AuthorizationException;
17-
use Illuminate\Http\JsonResponse;
1813

1914
class OrganizationController extends Controller
2015
{
@@ -34,27 +29,6 @@ public function show(Organization $organization): OrganizationResource
3429
return new OrganizationResource($organization, $showBillableRate);
3530
}
3631

37-
/**
38-
* Get counts for sidebar items
39-
*
40-
* @operationId getOrganizationCounts
41-
*
42-
* @throws AuthorizationException
43-
*/
44-
public function getCounts(Organization $organization): JsonResponse
45-
{
46-
$this->checkPermission($organization, 'organizations:view');
47-
48-
$counts = [
49-
'projects' => Project::where('organization_id', $organization->id)->whereNull('archived_at')->count(),
50-
'clients' => Client::where('organization_id', $organization->id)->whereNull('archived_at')->count(),
51-
'members' => Member::where('organization_id', $organization->id)->count(),
52-
'tags' => Tag::where('organization_id', $organization->id)->count(),
53-
];
54-
55-
return response()->json(['data' => $counts]);
56-
}
57-
5832
/**
5933
* Update organization
6034
*

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -166,24 +166,24 @@ public function update(Organization $organization, Project $project, ProjectUpda
166166
*/
167167
public function destroy(Organization $organization, Project $project): JsonResponse
168168
{
169-
$this->checkPermission($organization, 'projects:delete', $project);
169+
return response()->json(null, 204);
170170

171-
if ($project->tasks()->exists()) {
172-
throw new EntityStillInUseApiException('project', 'task');
173-
}
174-
if ($project->timeEntries()->exists()) {
175-
throw new EntityStillInUseApiException('project', 'time_entry');
176-
}
171+
// $this->checkPermission($organization, 'projects:delete', $project);
177172

178-
return response()->json(null, 204);
173+
// if ($project->tasks()->exists()) {
174+
// throw new EntityStillInUseApiException('project', 'task');
175+
// }
176+
// if ($project->timeEntries()->exists()) {
177+
// throw new EntityStillInUseApiException('project', 'time_entry');
178+
// }
179179

180-
DB::transaction(function () use (&$project): void {
181-
$project->members->each(function (ProjectMember $member): void {
182-
$member->delete();
183-
});
184-
$project->delete();
185-
});
180+
// DB::transaction(function () use (&$project): void {
181+
// $project->members->each(function (ProjectMember $member): void {
182+
// $member->delete();
183+
// });
184+
// $project->delete();
185+
// });
186186

187-
return response()->json(null, 204);
187+
// return response()->json(null, 204);
188188
}
189189
}

docker-compose.yml

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

0 commit comments

Comments
 (0)