diff --git a/app/Domains/Outputs/OutputTypeEnum.php b/app/Domains/Outputs/OutputTypeEnum.php
index 3a23de57..b5ae99da 100644
--- a/app/Domains/Outputs/OutputTypeEnum.php
+++ b/app/Domains/Outputs/OutputTypeEnum.php
@@ -11,6 +11,7 @@ enum OutputTypeEnum: string
case WebPage = 'web_page';
case EmailOutput = 'email_output';
+ case CalendarOutput = 'calendar_output';
case ApiOutput = 'api_output';
case EmailReplyOutput = 'email_reply_output';
//leave for scripting
diff --git a/app/Http/Controllers/CalendarController.php b/app/Http/Controllers/CalendarController.php
index eff60de9..cf411327 100644
--- a/app/Http/Controllers/CalendarController.php
+++ b/app/Http/Controllers/CalendarController.php
@@ -2,17 +2,22 @@
namespace App\Http\Controllers;
+use App\Domains\Outputs\OutputTypeEnum;
use App\Http\Resources\CollectionResource;
use App\Http\Resources\EventResource;
use App\Models\Collection;
use App\Models\Event;
use Carbon\Carbon;
-use Illuminate\Http\Request;
class CalendarController extends Controller
{
public function show(Collection $collection)
{
+ //for now if there is no related output we do a 404
+ if (! $collection->outputs()->where('type', OutputTypeEnum::CalendarOutput)->first()) {
+ abort(404);
+ }
+
// Parse the date from the query string, or use the current date if not provided
$date = request()->input('date') ? Carbon::parse(request()->input('date')) : now();
@@ -26,7 +31,7 @@ public function show(Collection $collection)
->get();
return inertia('Calendar/Show', [
- "collection" => new CollectionResource($collection),
+ 'collection' => new CollectionResource($collection),
'events' => EventResource::collection($events),
'startDate' => $startOfCalendar->format('Y-m-d'),
'endDate' => $endOfCalendar->format('Y-m-d'),
diff --git a/app/Http/Controllers/Outputs/CalendarOutputController.php b/app/Http/Controllers/Outputs/CalendarOutputController.php
new file mode 100644
index 00000000..495a7908
--- /dev/null
+++ b/app/Http/Controllers/Outputs/CalendarOutputController.php
@@ -0,0 +1,21 @@
+
+
+import {Link} from "@inertiajs/vue3";
+import Settings from "@/Pages/Outputs/Components/Settings.vue";
+
+const props = defineProps({
+ output: Object
+})
+
+
+
+