Comments (2)
You cannot do this natively with Waterline (moreover Waterline will be removed in v2).
You have to write a new controller in /api/user/controllers/User.js, and add this new route in /api/users/config/routes.json (or update the /user/:id one).
Somthing like:
findByUsername: function * () {
try {
const user = yield User.find({ username: this.params.username });
if (_.isEmpty(user)) {
this.status = 404;
} else {
this.body = user;
}
} catch (err) {
this.body = err;
}
},
from strapi.
Thank you. That's exactly what I did.
from strapi.
Related Issues (20)
- Strapi import fails error: update "public"."strapi_core_store_settings" set "value" = $1, "type" = $2 where ("id" = $3) - canceling statement due to statement timeout
- [Content Manager][i18n] Duplicate translated entity keep relation with duplicated entity
- Cloning will also clone relation to other languages HOT 1
- Graphql plugin breaking CMS app on v5.0.0-beta-3 HOT 6
- strapi export error Request failed with status code 404 HOT 1
- Typescript error: TS2339: Property getFetchParams does not exist on type HOT 1
- 500 server error while trying to upload images with cloudinary configaration HOT 2
- Strapi Transfer CLI Request failed with status code 401 HOT 1
- yarn develop - Creating admin never finishes HOT 1
- Strapi V5 beta : JSON field interpreted as a string HOT 4
- Can not load one to many relations in content manager
- TypeError: Cannot read properties of undefined (reading 'kind') when trying to create a new content type from dashboard or command line. HOT 1
- v4 (4.23.0): "strapi export" command doesn't accept any arguments HOT 3
- List label empty causes blank page
- Empty payload body connect when recreating a repeatable component with the same relation
- Spurious notification "Upgrade your admin panel" HOT 2
- Error: Undefined attribute level operator $and at applyOperator HOT 2
- White screen on navigating to a content type with nested components in the Content Manager
- A duplicated entry can be saved even if a unique field shares the same value as the original one HOT 2
- updating the relational field value and clearing it is throwing "Something went wrong message"- categories and sub categories
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strapi.