Skip to content

Commit

Permalink
Merge branch 'main' into improve-tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
GeniJaho committed Mar 13, 2024
2 parents c9b9de2 + 819a32e commit abf8950
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 13 deletions.
14 changes: 14 additions & 0 deletions app/Http/Controllers/DocsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Http\Controllers;

use Inertia\Inertia;
use Inertia\Response;

class DocsController extends Controller
{
public function __invoke(): Response
{
return Inertia::render('Docs');
}
}
14 changes: 14 additions & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Http\Controllers;

use Inertia\Inertia;
use Inertia\Response;

class HomeController extends Controller
{
public function __invoke(): Response
{
return Inertia::render('Home');
}
}
7 changes: 7 additions & 0 deletions app/Http/Controllers/UploadPhotosController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\UploadedFile;
use Inertia\Inertia;
use Inertia\Response;

class UploadPhotosController extends Controller
{
public function show(): Response
{
return Inertia::render('Upload');
}

public function store(
StorePhotosRequest $request,
ExtractsExifFromPhoto $extractExif,
Expand Down
1 change: 1 addition & 0 deletions resources/js/Pages/Photos/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const filter = (filters) => {
:photoIds="selectedPhotos"
:tags="tags"
:items="items"
@closeModalWithSuccess="clearSelection"
></BulkTag>
</div>

Expand Down
8 changes: 7 additions & 1 deletion resources/js/Pages/Photos/Partials/BulkTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const props = defineProps({
tags: Object,
});
const emit = defineEmits(['closeModalWithSuccess'])
const page = usePage();
const selectedItem = ref(null);
const showModal = ref(false);
Expand Down Expand Up @@ -69,7 +71,11 @@ const closeModalWithSuccess = () => {
form.reset();
message.value = 'Tagged successfully!';
setTimeout(() => showModal.value = false, 3000);
setTimeout(() => {
showModal.value = false;
emit('closeModalWithSuccess');
}, 3000);
};
const closeModal = () => {
Expand Down
18 changes: 6 additions & 12 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
use App\Http\Controllers\Auth\TwitterController;
use App\Http\Controllers\BulkPhotoItemsController;
use App\Http\Controllers\CopyPhotoItemController;
use App\Http\Controllers\DocsController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\PhotoItemsController;
use App\Http\Controllers\PhotoItemTagsController;
use App\Http\Controllers\PhotosController;
use App\Http\Controllers\PhotoTagsController;
use App\Http\Controllers\UploadPhotosController;
use App\Http\Controllers\UserSettingsController;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;

/*
|--------------------------------------------------------------------------
Expand All @@ -25,12 +26,8 @@
|
*/

Route::get('/', function () {
return Inertia::render('Home');
})->name('home');
Route::get('/docs/en/', function () {
return Inertia::render('Docs');
})->name('docs');
Route::get('/', HomeController::class)->name('home');
Route::get('/docs/en/', DocsController::class)->name('docs');

Route::get('/auth/google/redirect', [GoogleController::class, 'redirect'])->name('auth.google.redirect');
Route::get('/auth/google/callback', [GoogleController::class, 'callback']);
Expand All @@ -44,9 +41,8 @@
config('jetstream.auth_session'),
'verified',
])->group(function () {
Route::get('/upload', function () {
return Inertia::render('Upload');
})->name('upload');
Route::get('/upload', [UploadPhotosController::class, 'show'])->name('upload');
Route::post('/upload', [UploadPhotosController::class, 'store']);

Route::get('/my-photos', [PhotosController::class, 'index'])->name('my-photos');
Route::get('/photos/{photo}', [PhotosController::class, 'show'])->name('photos.show');
Expand All @@ -64,7 +60,5 @@

Route::post('/photo-items/{photoItem}/copy', CopyPhotoItemController::class);

Route::post('/upload', [UploadPhotosController::class, 'store']);

Route::post('/settings', [UserSettingsController::class, 'update'])->name('user-settings.update');
});

0 comments on commit abf8950

Please sign in to comment.