Posts by Fred • 499 points
46 posts
-
-2
votes2
answers192
viewsQ: How to pick specific field of an object array using the material ui autocomplete component
I have a Material UI autocomplete component, created using the package formik-material-ui. The component renders an array of model objects below: const teams = [ {id: 1, name: 'Barcelona'}, {id: 2,…
-
0
votes1
answer37
viewsQ: Auto increment in postgres/sequelize
I have a Postgres database using Sequelize (Node/express) as ORM. I have a table called Students, there are columns: id and name. In this table Students, I have several registered students, however,…
-
-1
votes2
answers115
viewsQ: Join two arrays if field is equal in both
I have two arrays: Exam: [ { "id": 1, "title": "Avaliação - Procedimento em Serras", "description": "Uma pequena descrição sobre a avaliação." }, { "id": 3, "title": "Avaliação de Recuperação -…
-
-1
votes1
answer26
viewsQ: Render radio Buttons based on arrays
I am developing an online school evaluation. I get some questions and each question has several options for selection. Need to show options like Radio Buttons, allowing user to select 1 option by…
-
0
votes1
answer108
viewsQ: Implement radio Buttons using the unform library
I get the following array of an API: Array Exam: [ { id: 2, question: 'Questão 1:', essay_question: false, value: '2.00', options: [ { id: 1, option: 'Opção A', correct: false, question_id: 2, }, {…
-
0
votes2
answers54
viewsQ: Map array and include ID items using MAP and FILTER
I have two arrays: The first has some questions, ex: Array questions: [ { "id": 2, "question": "Questão 1:", "essay_question": false, "value": "2.00" }, { "id": 3, "question": "Questão 2:",…
-
-2
votes1
answer43
viewsQ: Show array first element that may not have been loaded using React
I am developing a quiz application using React for study purposes. I have the state called Quiz, the same consists of: interface QuestionData { id: number; question: string; explanation: string;…
-
0
votes2
answers52
viewsQ: Add element based on array comparison
I have two arrays: videos = [{ "id": number, "title": string, "url": string }] watched = [{ "video_id": number }] "video_id" is added when a user watches a specific video, this ID is the same as in…
-
7
votes4
answers798
viewsQ: Search id in object array with Javascript
Hello, I have the following object array: [ { "id": 97, "name": "Jon", "technologies": [ { "id": 6, "name": "React" }, { "id": 7, "name": "Messageria" } ] }, { "id": 98, "name": "Doe",…
javascriptasked Fred 499 -
1
votes0
answers19
viewsQ: Perform query - relation Many to Many - Sequelize
I have a problem to perform a query using the Sequelize ORM. The structure is as follows: Migrations/tables: Developers, Technologists, developers_dechnologies. The relationship between developers…
-
1
votes2
answers626
viewsA: Reset React-Select (Unform) after Ubmit
I didn’t get so many negatives.. I posted the same doubt in gringo stackoverflow, helped me and even gave +1.. Finally, I was able to solve using the solution of taking the ref from the field and…
-
-4
votes2
answers626
viewsQ: Reset React-Select (Unform) after Ubmit
I’m studying Reactjs and Typescript, and also a lib for forms called Unform (https://github.com/Rocketseat/unform). I have a form with some fields, among them a Select field…
-
-2
votes1
answer102
viewsQ: Belongstomany Relationship - Sequelize
Hello, I have a problem in listing records with belongsToMany association using sequelize + nodejs. I have the tables Developers and Technologies. The relationship between them is Many to Many. To…
-
0
votes1
answer226
viewsA: Problem when creating Many to Many association using Sequelize (belongsToMany)
I found the problem, I was referring to the Course model incorrectly, the correct is Courses. Thanks @William Prigol Lopes…
-
0
votes1
answer226
viewsQ: Problem when creating Many to Many association using Sequelize (belongsToMany)
I am getting the following error when defining a Many to Many association between two tables: C:\eadfabet\node_modules\sequelize\lib\associations\mixin.js:49 throw new…
-
0
votes0
answers57
viewsQ: Access value in HTTP response
Hello!! I’m implementing a login method. When the user logs in, the backend generates a JWT and sends the token to be stored in the HTML localStorage. I never used TS/Angular 4, Angularjs had no…
-
1
votes1
answer293
viewsQ: Add document subdocuments - Mongoose
Good evening! I have the following document: { "_id" : ObjectId("5b21a4332a5e3333cc64a12f"), "nome" : "João", "sobrenome" : "Barbosa", "cpf" : "12345678910", "senha" : "Fabet@1010", "viagem" : [ {…
-
0
votes0
answers256
viewsQ: No 'Access-Control-Allow-Origin' header is present on the requested Resource. - MEAN STACK
Hello! I need to pass a string to Node and am receiving the following response in the browser console: Failed to load http://localhost:3003/api/buscarCep: No 'Access-Control-Allow-Origin' header is…
-
2
votes2
answers1515
viewsQ: Cross-origin requests are being blocked
I need to consult some Ceps in viacep API (https://viacep.com.br), when I run get below: vm.buscarCEP = function(){ const cep = vm.empresaResponsavel.cep //RECEBE CEP DO CAMPO const apiViaCep =…
-
8
votes1
answer221
views -
0
votes1
answer554
viewsQ: Date and Time Form - Angularjs
I have a form with the option to choose date and Time. I’m using the Datepicker and Timepicker components. <!-- Date --> <div class="col-xs-12 col-md-3 col-lg-3"> <div…
-
0
votes2
answers622
views -
1
votes1
answer123
viewsQ: Problem registering objects nested in Mongodb with Mongoose
I have the following collection: // SUSPEITOS - INICIO // const suspeitosSchema = new mongoose.Schema({ nome: { type: String }, sexo: { type: String }, corPele: { type: String }, altura: { type:…
-
0
votes2
answers668
viewsA: NG-REPEAT inside NG-REPEAT - ANGULARJS
I ended up being able to solve using ng-repeat-start and ng-repeat-end. Follow: <table> <tbody> <tr ng-repeat="section in sections"> <td ng-repeat-start="tutorial in…
-
1
votes2
answers668
viewsQ: NG-REPEAT inside NG-REPEAT - ANGULARJS
I have a multidimensional array. To demonstrate it in my view I use an ng-repeat in a ul inside another ng-repeat in a li, thus: <ul ng-repeat="section in sections"> <li>…
-
1
votes1
answer624
views -
0
votes1
answer295
viewsQ: Problem when doing branch checkout - Bitbucket
I created a branch in bitbucket and I can’t check out anyway. The command I normally use is: git fetch && git checkout I type the command into the local terminal and it simply checks out on…
-
-2
votes2
answers151
viewsA: Count function - Mysql
I managed to solve. SELECT t.time_nome, SUM(r.rod_pontos) PONTOS FROM rodadas r INNER JOIN times t WHERE t.time_id = r.rod_fk_time GROUP BY r.rod_time ORDER BY SUM(r.rod_pontos) DESC…
-
1
votes2
answers151
viewsQ: Count function - Mysql
I have the following tables: times - time_id INT - time_nome VARCHAR rodadas - rod_id INT - rod_rodada INT - rod_pontos DECIMAL (10,2) - rod_fk_time INT I need to add the score and group by team.…
-
1
votes2
answers1485
viewsQ: Loading with Angularjs
I have an object that indicates that the page is being loaded. However, it is not working properly, it follows code: HTML: <div class="fundo_login"> <div class="carregando_inicio"…
-
1
votes1
answer129
viewsA: How to make a "Home" Bay and others render the main page of my html document?
Hello, your syntax is incorrect. Below is the right code. <ul class="nav"> // faltou o '=' entre class e "nav"; <li><a href="enderecodahome"> Home </a></li> //Haviam…
-
0
votes2
answers739
viewsA: Map Leaflet - Access extends
I was able to do what I wanted. I have a table with the name of the cities and when the user clicks on the city, changes the map coordinates to the selected city. This is my click function:…
-
2
votes2
answers739
viewsQ: Map Leaflet - Access extends
Hello, I’m using the directive "Angular Leaflet Directive" (http://tombatossals.github.io/angular-leaflet-directive/#!/) next to the Leaflet map. My question is the following, there is the…
-
1
votes1
answer875
viewsA: XAMPP is not working properly
Try to start apache and mysql manually, run the commands below in the terminal as root: Apache: $ sudo /etc/init.d/apache2 start Mysql: $ sudo /etc/init.d/mysql start It will probably return some…
-
2
votes2
answers925
viewsQ: $window.location.Reload()
I use Angularjs in a webapp, in this webapp I have implanted a map showing my clients from a marker. The map I’m using is Leaflet (http://leafletjs.com/) with a directive for Angularjs…
-
-1
votes3
answers85
viewsA: Third IF ELSE
In the third condition you are assigning the value 11 to c_char. The correct is to compare (==). Another tip I use a lot is to put "console.log" in the conditions, to see what time the code stops,…
-
0
votes1
answer403
viewsA: Map opens bugado
I was able to solve it this way: vm.esconderMostrarMapa = false; vm.mostrarMapa = function () { $timeout(function() { vm.esconderMostrarMapa = true; }, 500); } The map starts as false, then when it…
-
0
votes1
answer403
viewsQ: Map opens bugado
Good morning! I have a web application, where I use a leafletjs map (http://tombatossals.github.io/angular-leaflet-directive/#!/) and openstreetmap as Tile. The map works perfectly, I can interact…
-
-1
votes3
answers820
views -
4
votes3
answers820
views -
0
votes1
answer314
viewsQ: Xdebug - xampp php7
Good afternoon guys, I researched several places on how to activate Xdebug and found some solutions, but none of them worked here. The simplest way I’ve ever used is to uncheck the ; from the…
-
0
votes1
answer124
viewsQ: PHP recursive directory
I need to include a file from a recursive directory, I’m using the following form: <?php require_once '../../cabecalho.php'; ?> Okay, here’s what’s going on. The header, which would be the…
-
0
votes2
answers457
views -
0
votes1
answer97
viewsQ: How to adapt this code to different screens
I’m having a problem using a slider vertical, the Swiper Slider I’m using the Mousewheel control. My problem is this, how he’s a vertical slider, need to set a size for the height, so I can’t make…
-
3
votes2
answers1716
viewsQ: Displays items as selected from a select (HTML)
Good afternoon! I have a database with two tables, products and menus, the two tables are indexed through the Cdcardapio field. I created an html select element that contains all the registered…
-
1
votes2
answers737
viewsQ: Change element with jquery
Hello, I have a problem, in the code below I have a table of products, where they have a value (R$) and an input for the customer to choose a quantity. I need that when the customer changes the…