Most voted "adonisjs" questions
45 questions
Sort by count of
-
7
votes2
answers421
viewsHow to apply conditions in this string template?
Currently I own this object: const messages = { required: field => `${field} é obrigatório e naõ foi preenchido!`, } That prints the following value: name é obrigatório e não foi preenchido! I…
-
5
votes1
answer462
viewsSchema modularization using Adonisjs and Graphql
I have a project where I am using Adonisjs and Graphql, I created the schema and defined the darlings, mutations, types. But everything was centered on just one file, so I decided to modularize the…
-
3
votes1
answer119
viewsHow do you protect a stateless API built on the Adonis framework against CSRF and XSS attacks?
Consider a REST API stateless with all endpoints protected with authentication, except endpoint for authentication. The authentication endpoint returns a JWT which is later sent in all requests…
-
2
votes1
answer89
viewsUser Creation Api Is Returning Status 204 In Content
I’m developing an api that I get the id the user of the request through the token, I store in my user object and I register this user. The problem is that it is not returning anything, even if I put…
-
1
votes1
answer33
viewsHow to popular data from another table when a new user is created in Adonisjs
I am starting in Adonisjs and came across the following scenario: I have a table of user_config that is populated from the creation of a new user. Doubt: I would like to know first how to do so that…
-
1
votes1
answer481
viewsHow to Relationship in Seeds and Factories in Adonisjs
I have the following question regarding Seeds and Factories. I have the following scenario: When the user is created automatically I need to create a settings record in the Userconfig table with the…
-
1
votes1
answer135
viewsWhat is the difference between "merge" and "Fill" in Adonisjs' Lucid?
I have several years of experience with Laravel and am taking a look at the Adonisjs framework. It is very similar to the Laravel in several points, but specifically I’m having a doubt regarding the…
-
1
votes2
answers1098
viewsHow to write this SQL with Adonis query Builder?
Hello, I’m starting with Adonis and I have problems/difficulty to assemble a query. My simplified Sql is like this: SELECT DISTINCT dtd.id_disciplina, dis.nome_disciplina FROM…
-
1
votes0
answers30
viewsSocket.io. How to connect and upload user id
By default the socket.io generates a unique id. I need this id to be the same id as the user in the database. Have any way to set the id? if not, how my client front recovers the id generated by the…
-
1
votes0
answers128
viewsHow to return token in user registration in Adonis?
I am creating a user registration api and would like to return beyond the registered user, the jwt token. These are currently my duties: initializeCreate( {request} ){ const data =…
-
1
votes0
answers66
viewsI can’t get a relationship going Lucido on Adonis
I have the following schema: Book: class BookSchema extends Schema { up () { this.create('books', (table) => { table.increments() table.string('description') table.timestamps() }) } Bookunit:…
-
1
votes1
answer513
viewsNodejs/Adonis Application Deploy on Heroku: Receiving 503 Status: Unvailable Service
I’m trying to deploy an API-only application using Heroku, but I deploy it and when I try to get a route I get: Status: 503 Service Unvailable. Man Procfile: release: ENV_SILENT=true node ace…
-
0
votes1
answer33
viewsError 500 when performing an authentication request with Adonisjs
I have a Sessioncontroller, which is the method that performs the user authentication process in the application. class SessionController { async store ({ request, response, auth }) { const data =…
-
0
votes1
answer24
viewsHow to recover the value of a select option in Adonisjs?
<select class="custom-select mr-sm-2" id="inlineFormCustomSelect"> <option name="tipo" value="MEMORIA" selected>MEMORIA</option> <option name="tipo" value="HD SSD">HD…
-
0
votes1
answer544
viewsHow to return a specific status with Adonis.js/Node
I am trying to return a specific status and a message in my api, I tried this way: return response.status(409).json({message: 'User already registered'}) But I’m getting: Response is not defined I…
-
0
votes0
answers214
viewsHow to change the Adonisjs hash to md5?
Hello, I am developing an api on top of a legacy project used by other systems, and I intend to perform an authentication using md5 instead of bcrypt to compare the password only. There is already a…
-
0
votes1
answer221
viewsYou need the id for 'params.id' on the route and I already have the id in auth.user.id? Adonisjs
I have the following question when creating my user’s Routes and Controller. I see that when I create the route with Route.Source automatically Adonis creates the CRUD routes and passing the ID in…
-
0
votes2
answers608
viewsError installing adonisJS
Hello I’m trying to install Adonis but it’s giving error (I’ve checked with sudo npm i -g @adonisjs/cli): gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir…
-
0
votes2
answers650
viewsHow to work with JWT authentication header in Adonisjs?
To get to the point, I want to know how to work correctly with JWT on Adonisjs (I’m learning to use the framework and I’ve never worked with JWT before). My problem now is that I don’t want to keep…
-
0
votes1
answer309
viewsAdonisjs, how to update multiple tables with just one await?
I’m learning to work with Adonisjs and I found several ways to update, but I always like the most performative way, after reading several articles and the documentation came to the following code:…
-
0
votes1
answer990
viewsWhat is wrong in this Adonisjs relationship
I’m having the following mistake when I give Adonis Migration:run : { error: relation "polo" does not exist at Connection.parseE (C:\ckinfo\node_modules\pg\lib\connection.js:604:11) at…
-
0
votes2
answers331
viewsAdonis make:model generating model with different name
I executed the Adonis command make:model Caredperson -mc so that the controller and Migration were created together. After executing the command, I tried to change the name of the model, Migration…
-
0
votes1
answer1043
viewsHow can I create a Many to Many relationship in Adonisjs?
Well, I created a Many to Many relationship, just as I saw in the documentation, some posts and some videos on the internet, I was not successful in any attempt by some mistake of mine that I can’t…
-
0
votes1
answer206
viewsAdd Where’s in query if you receive filter parameter in Adonis/Node
Currently I have this query that returns all users: async index({request}) { const page = request.input('page') const pageSize = request.input('pageSize') const users = await User .query()…
-
0
votes1
answer377
viewsMiddleware that saves a user_id after a request to Adonis.js/Node.js
I own the following table job: job -------------- id INTEGER PK, name VARCHAR, user_id INTEGER FK I need to save in the column user_id the id of the user who created that record. I tried to create…
-
0
votes2
answers85
viewsHow to select records that do not have relationships in a table in Node/Adonis?
I have three tables: students ------------ id INT name VARCHAR class ----------- id INT description VARCHAR student_classes -------- id INT student_id (FOREIGN KEY of students.id) class_id (FOREIGN…
-
0
votes1
answer281
viewsValidation of regex with Indicative (adonisJs)
I am trying to validate a CPF with regex using the Adonis Database. I tried that way: const { validations } = use('indicative/validator') const { validate } = use('Validator') const rules = (values)…
-
0
votes1
answer51
viewsPass database data to a View in Adonisjs
I am searching for a specific data in the database to return its values in a view (Edgetemplate) But in the view shows how Undefined My route Route.get('/atendimentos/:id_atendimento',…
-
0
votes1
answer128
viewsUsing an existing table with Adonisjs
I am a beginner with the Adonisjs framework and need to use it in an existing table with data. Researching I found that I should create a Model for the table, but it didn’t work and I couldn’t find…
-
0
votes2
answers124
viewsHow to update some fields of a table
I am using the framework based on Java Scrit and Nodejs,Adonisjs.Need to update some fields in a table. Table fields user need to be changed, by default they come NULLS. The fields are…
-
0
votes1
answer80
viewsReact Nextjs - Path of the Undefined parameter after giving Refrech ( F5 ) on the page
Note: Eco Systems used here: Nextjs, Adonisjs and Mysql I have following code where I make a news presentation, what happens is the following... right after I come from the news listing, and select…
javascript node.js react adonisjs nextasked 4 years, 5 months ago Carlos Gustavo Souza Guimarães 42 -
0
votes1
answer94
viewsAccess denied when I put two roles on routes using Adonis Acl
Hello, I’m trying to get the administrator and the patient to access some of the routes in my system. But the structure only works when I put only one roll in 'is:(administrador || paciente)' at the…
-
0
votes1
answer32
viewsHow to make a recursive model relationship in Nodejs (Adonis)?
Hello, I’m having a doubt that I haven’t found anywhere yet (or didn’t know how to look). In Laravel/Cakephp I can easily relate models and make queries with models recursively. How can I make with…
-
0
votes1
answer58
viewsCompare if the value of a variable is the same as the value already saved in the database
Using Java Script, Nodejs, Adonisframework, Mysql, Lucid ORM I need to check compare if the value sent by the client through the API is the same present in my database. I need to check if the…
-
0
votes1
answer23
viewsHeroku - Error run seeder for popular BD
Hello. I recently deployed an application to Heroku (Node + Adonis + Mysql + React) and I am facing some problems. It has an admin user who is responsible for registering other users, so I have some…
-
0
votes0
answers16
viewsI am unable to return complete data with adonisjs
Code of the Model 'use strict' const honorarios = require('../Metodos/honorarios') /** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */ const Model = use('Model') class ControleHonorario…
-
-1
votes1
answer411
viewsError -4058 Npm install
Good afternoon, lately, when I try to install a dependency via npm install, it sometimes happens, already[! [insert image description here solved once deleting node_modules and giving an install…
-
-1
votes1
answer381
viewsConfiguring Eslint with adonisjs
I’m trying to configure Eslint in a project that uses Adonisjs but he asks me what kind of modules the project uses, Javascript Modules, Commonjs or none of these. Could someone tell me what kind of…
-
-1
votes1
answer289
viewsLoad route by clicking on the menu inside a component (Dashboard)
Now I’m using the Adonis (I love the Laravel) and doing the Reactjs case here on the blog. more I came across the following situation: I have an admin Dashboard, where the same has: Header.js…
-
-1
votes1
answer88
viewsHow to find a word in this query params?
I’m doing a query that performs where based on the string filter received in query params. My filter query params has this format: filter: (status~contains~false~and~username~contains~'admin') I…
-
-1
votes1
answer330
viewsHow to filter relationships in Donis?
I pass this query: const filter = request.input('filter') const queryBookQuestions = BookUnitQuestion .query() .with('book_unit') .with('user') .with('book', (builder) => { builder.where('id',…
-
-1
votes1
answer222
viewsProperty of my object is returning Undefined
I have the following function: async geraQuiz(idEstudante) { let idioma = new Array() let livrosUnidadesGerarQuiz = new Array() const idsClassesEstudante = await…
-
-2
votes1
answer159
viewsHow to format dates in Adonisjs?
How can I send DD-MM-YYYY formatted dates to the Adonisjs database? class AtendimentoSchema extends Schema { up () { this.create('atendimentos', (table) => { table.increments()…
-
-2
votes1
answer73
viewsCreate object containing only some attributes of another
Is there any possibility of creating an object with only a few attributes of another? In Adonis, it is possible to filter which exact fields to pick from one request object and already create…
-
-2
votes1
answer806
viewsReturning the result of a query to the external API with Adonisjs
I am consuming an external API with Request in an application made with adonisjs, to request is done normally and is returning the statusCode and body but I cannot return to my API. I want to return…