Posts by Mozelli • 45 points
11 posts
-
1
votes1
answer68
viewsA: Test error - Chai/Mocha
I found the problem! I was calling the function I want to test when I wrote: chai.request(User.storeNewUser).post('/users').send({ The correct thing is I call the application as now: const app =…
-
1
votes1
answer68
viewsQ: Test error - Chai/Mocha
Hello! I’m studying unit trials with Chai and Mocha. I’ve never touched it before, but now I’m feeling the need to learn about it. I have the following code: module.exports = { //Create - Method…
-
0
votes1
answer228
viewsQ: Sequelize db:migrate error
Hello! I have a DB Postgres running perfectly on my machine. I can create my Migrations, for example in the following command: npx sequelize migration:create --name=create-users I am trying to run a…
-
0
votes2
answers150
viewsQ: I can’t create a Schema in Mongoose
Hello! I am learning to use Mongoose. I am trying to create a model, but the terminal is returning the following error: "Cannot read Property 'Schema' of Undefined" Where I’m going wrong? Follow the…
-
-2
votes1
answer20
viewsQ: PDO returns only one rewrite
Hello. My algorithm is only returning a record from the database. I have reviewed the code several times, but I cannot understand the reason. I’m using the Slim Framework. Follows the code: index…
-
0
votes1
answer84
viewsQ: can not read Property 'map' of Undefined
I’m trying to create some dynamic checkboxes, but when I run the browser informs "ERROR Typeerror: Cannot read Property 'map' of Undefined" Because? export class FormPostsComponent implements OnInit…
-
1
votes1
answer23
viewsQ: Dynamic checkboxes
I am wanting to create dynamic checkboxes. This code should give me, in the field categories, an object with 3 items false, but it’s not working. Where am I going wrong? export class…
-
-1
votes1
answer31
viewsQ: I can’t pass a value to a variable
Because in console.log(x) the terminal shows me the array and in console.log("Categories: " + this.Categories) it shows me Undefined? buildCategories() { const teste = this.categoriesService.read();…
-
0
votes3
answers324
viewsA: Error with map operator
I managed to solve Eduardo Varga. Thanks for the guidelines. The Component that receives the Injection should look like this: ngOnInit() { this.categoriasService.categorias().subscribe(categorias…
-
0
votes3
answers324
viewsQ: Error with map operator
I’m starting now with Angular 6. When I tried to create a service to consume data from an api, the following error appeared: import { Injectable } from '@angular/core'; import { Http } from…
-
0
votes3
answers63
viewsQ: I cannot retrieve JSON in jQuery
I’m having trouble showing off uf in the following situation: $.post("<?php echo site_url('Welcome/viacep'); ?>", {cep: cep}, function(dados){ alert(dados.uf); }, 'json' ); But when I change…