-
Notifications
You must be signed in to change notification settings - Fork 1
#21 - Pet Preferences Selection Page #51
base: main
Are you sure you want to change the base?
Conversation
EwelinaSkrzypacz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I logged as a [email protected] -> I go to "Zwierzęta" -> I see error
Btw. I think that not authenticated user should also see page with pets 👀
|
Conflicts 👀 |
…eController and tests, drop JS entrypoint in favor of app.ts
|
@TomaszRebizant conflicts |
AleksandraKozubal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my old comments, they're not resolved yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
| use Illuminate\Database\Eloquent\Model; | ||
| use Illuminate\Database\Eloquent\Relations\BelongsToMany; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /** | |
| * @property string $name | |
| * @property-read Collection<int, Pet> $pets | |
| */ |
Also add * @property-read Collection<int, Tag> $tags to Pet model
| continue; | ||
| } | ||
| $list = array_is_list($prefValues) ? $prefValues : [$prefValues]; | ||
| $normalized[$field] = array_values(array_filter($list, static fn($p) => is_array($p) && (array_key_exists("value", $p) || array_key_exists("weight", $p)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function types
| return Inertia::render("Dashboard/Dashboard", [ | ||
| "pets" => PetMatchResource::collection($pets)->resolve(), | ||
| $tags = Tag::query() | ||
| ->withCount(["pets as accepted_pets_count" => fn($q) => $q->where("is_accepted", true)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function types
| "pets" => PetMatchResource::collection($pets)->resolve(), | ||
| $tags = Tag::query() | ||
| ->withCount(["pets as accepted_pets_count" => fn($q) => $q->where("is_accepted", true)]) | ||
| ->whereHas("pets", fn($q) => $q->where("is_accepted", true), ">", 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
| "count" => (int)$tag->accepted_pets_count, | ||
| ]); | ||
|
|
||
| $breedQuery = fn(string $species) => Pet::query() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type
|
@TomaszRebizant conflicts |

This should close #21