@@ -218,9 +218,9 @@ func (q *sqlQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg GetWorkspa
218
218
func (q * sqlQuerier ) GetAuthorizedWorkspaceCount (ctx context.Context , arg GetWorkspaceCountParams , authorizedFilter rbac.AuthorizeFilter ) (int64 , error ) {
219
219
// In order to properly use ORDER BY, OFFSET, and LIMIT, we need to inject the
220
220
// authorizedFilter between the end of the where clause and those statements.
221
- filter := strings .Replace (getWorkspaces , "-- @authorize_filter" , fmt .Sprintf (" AND %s" , authorizedFilter .SQLString (rbac .NoACLConfig ())), 1 )
221
+ filter := strings .Replace (getWorkspaceCount , "-- @authorize_filter" , fmt .Sprintf (" AND %s" , authorizedFilter .SQLString (rbac .NoACLConfig ())), 1 )
222
222
// The name comment is for metric tracking
223
- query := fmt .Sprintf ("-- name: GetAuthorizedWorkspaces :many\n %s" , filter )
223
+ query := fmt .Sprintf ("-- name: GetAuthorizedWorkspaceCount :many\n %s" , filter )
224
224
rows , err := q .db .QueryContext (ctx , query ,
225
225
arg .Deleted ,
226
226
arg .Status ,
@@ -229,8 +229,6 @@ func (q *sqlQuerier) GetAuthorizedWorkspaceCount(ctx context.Context, arg GetWor
229
229
arg .TemplateName ,
230
230
pq .Array (arg .TemplateIds ),
231
231
arg .Name ,
232
- arg .Offset ,
233
- arg .Limit ,
234
232
)
235
233
if err != nil {
236
234
return 0 , xerrors .Errorf ("get authorized workspaces: %w" , err )
0 commit comments