Skip to content

Commit 3274218

Browse files
committed
v1_user - returns array for full, object for min.
1 parent bcad4d7 commit 3274218

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

api/v1_user.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,11 @@ func (app *ApiServer) v1User(c *fiber.Ctx) error {
2222
return sendError(c, 404, "user not found")
2323
}
2424

25-
return v1UsersResponse(c, users)
25+
// full returns an array
26+
// non-full returns an object
27+
// wild
28+
if c.Locals("isFull").(bool) {
29+
return v1UsersResponse(c, users)
30+
}
31+
return v1UserResponse(c, users[0])
2632
}

0 commit comments

Comments
 (0)