Skip to content

Commit

Permalink
fix project view
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Jan 29, 2024
1 parent d19cb74 commit d60e5d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ protected function projectList(Request $request, string $view): Response

public function show(Project $project)
{
if (! $project->isPublished() && ! auth()->check()) {
abort(403);
if (! $project->isPublished() ) {
$this->authorize('view', $project);
}


return Inertia::render('Public/Projects/Show', [
'project' => new ShowProjectResource($project),
]);
Expand Down
2 changes: 1 addition & 1 deletion database/factories/OrganizationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function configure(): static

$projects = Project::factory()
->for($organization)
->count(2)
->count(3)
->hasAttached(
Volunteer::factory()
->count(1),
Expand Down
2 changes: 1 addition & 1 deletion database/factories/ProjectFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Illuminate\Support\Str;

/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Project>
* @extends Factory<Project>
*/
class ProjectFactory extends Factory
{
Expand Down
6 changes: 3 additions & 3 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public function run(): void
->create();

Organization::factory()
->count(50)
->count(5)
->approved()
->create();

Organization::factory()
->count(1)
->count(5)
->rejected()
->create();

Organization::factory()
->count(1)
->count(5)
->pending()
->create();

Expand Down

0 comments on commit d60e5d7

Please sign in to comment.