wip: add custom /sexy/models endpoint to bypass permissions
- Add /sexy/models endpoint in bundle with accountability: null - Update getModels() and getFeaturedModels() to use custom endpoint - Still experiencing permissions issues with field access - Need to configure Directus public role permissions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -351,10 +351,9 @@ export async function getModels(fetch?: typeof globalThis.fetch) {
|
||||
return loggedApiCall("getModels", async () => {
|
||||
const directus = getDirectusInstance(fetch);
|
||||
return directus.request<Model[]>(
|
||||
readUsers({
|
||||
fields: ["*"],
|
||||
filter: modelFilter,
|
||||
sort: ["-join_date"],
|
||||
customEndpoint({
|
||||
method: "GET",
|
||||
path: "/sexy/models",
|
||||
}),
|
||||
);
|
||||
});
|
||||
@@ -369,11 +368,9 @@ export async function getFeaturedModels(
|
||||
async () => {
|
||||
const directus = getDirectusInstance(fetch);
|
||||
return directus.request<Model[]>(
|
||||
readUsers({
|
||||
fields: ["*"],
|
||||
filter: { _and: [modelFilter, { featured: { _eq: true } }] },
|
||||
sort: ["-join_date"],
|
||||
limit,
|
||||
customEndpoint({
|
||||
method: "GET",
|
||||
path: `/sexy/models?featured=true&limit=${limit}`,
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user