Skip to content

Discrepancy in location totals in API based on archived status #17565

@snipe

Description

@snipe

This isn't so much of a duplicate of #13752 but more of a re-statement of the issue.

A few things I noticed when looking at the locations index vs the locations detail. First, the locations API endpoint does't take the ->AssetsForShow() scope into consideration, which is why the number don't match.

With "Show archived in lists", the numbers don't agree, but with it unchecked, they do agree, meaning the count on the tabs is correct, the API response isn't being scoped properly.

The tabs do use that scope:

{{ number_format($location->assets()->AssetsForShow()->count()) }}

Screen.Recording.2025-08-11.at.12.43.56.PM.mov

Additionally, code like this won't work:

<div id="users" @class(['tab-pane','active' => $location->users->count() > 0 ]) >

since it will assign the active class to every tab with a count of over 0.

Sub-issues

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Ready

Relationships

None yet

Development

No branches or pull requests

Issue actions