Skip to content

Commit

Permalink
Merge pull request #626 from canyongbs/olympus-17
Browse files Browse the repository at this point in the history
[OLYMPUS-17]: Delete New Tenant on Advising App Dev
  • Loading branch information
Orrison authored Mar 27, 2024
2 parents 48af282 + ebaee5f commit e58bf48
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/Http/Controllers/Tenants/CreateTenantController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

namespace App\Http\Controllers\Tenants;

use Illuminate\Http\JsonResponse;
use App\Multitenancy\Actions\CreateTenant;
use App\Http\Requests\Tenants\CreateTenantRequest;
use App\Multitenancy\DataTransferObjects\TenantUser;
Expand All @@ -48,9 +49,9 @@

class CreateTenantController
{
public function __invoke(CreateTenantRequest $request): void
public function __invoke(CreateTenantRequest $request): JsonResponse
{
app(CreateTenant::class)(
$tenant = app(CreateTenant::class)(
$request->validated('name'),
$request->validated('domain'),
new TenantConfig(
Expand Down Expand Up @@ -106,5 +107,9 @@ public function __invoke(CreateTenantRequest $request): void
password: $request->validated('user.password'),
),
);

return response()->json(['tenant' => [
'id' => $tenant->getKey(),
]]);
}
}
47 changes: 47 additions & 0 deletions app/Http/Controllers/Tenants/DeleteTenantController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

/*
<COPYRIGHT>
Copyright © 2016-2024, Canyon GBS LLC. All rights reserved.
Advising App™ is licensed under the Elastic License 2.0. For more details,
see https://github.com/canyongbs/advisingapp/blob/main/LICENSE.
Notice:
- You may not provide the software to third parties as a hosted or managed
service, where the service provides users with access to any substantial set of
the features or functionality of the software.
- You may not move, change, disable, or circumvent the license key functionality
in the software, and you may not remove or obscure any functionality in the
software that is protected by the license key.
- You may not alter, remove, or obscure any licensing, copyright, or other notices
of the licensor in the software. Any use of the licensor’s trademarks is subject
to applicable law.
- Canyon GBS LLC respects the intellectual property rights of others and expects the
same in return. Canyon GBS™ and Advising App™ are registered trademarks of
Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks
vigorously.
- The software solution, including services, infrastructure, and code, is offered as a
Software as a Service (SaaS) by Canyon GBS LLC.
- Use of this software implies agreement to the license terms and conditions as stated
in the Elastic License 2.0.
For more information or inquiries please visit our website at
https://www.canyongbs.com or contact us via email at [email protected].
</COPYRIGHT>
*/

namespace App\Http\Controllers\Tenants;

use App\Models\Tenant;

class DeleteTenantController
{
public function __invoke(Tenant $tenant): void
{
$tenant->delete();
}
}
7 changes: 7 additions & 0 deletions routes/landlord_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,16 @@
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\UpdateBrandSettingsController;
use App\Http\Controllers\Tenants\CreateTenantController;
use App\Http\Controllers\Tenants\DeleteTenantController;

Route::post('tenants', CreateTenantController::class)
->name('tenants.create');

Route::delete('tenants/{tenant}', DeleteTenantController::class)
->name('tenants.delete');

Route::post('brand', UpdateBrandSettingsController::class)
->name('brand.update');

Route::post('test', fn () => true)
->name('test');

0 comments on commit e58bf48

Please sign in to comment.