I have two DTOs. UsersDTO and UserDTO. UsersDTO are showing in swagger, because I have an endpoint to get users list, and for that endpoint I have @ApiOkResponse({ status: HttpStatus.OK, …
Category: Questions
How to append a string and html tag in ternary operator condition?
I have a ternary condition in React Here, this.trimStringLength provides a trim string. The result should be “some data here see more…” but I am geeting “some data here[object Object]” How can I concatenate to get the required result? Answer Use a Fragment: E.g.:
Transform Tree in Array to display with React Flow and Dagre
I have this tree: And I want to transform the data in this format so I can display with React-Flow (example here: https://reactflow.dev/examples/layouting/ This is the format I want: So ultimately I need to convert it to an array, get all the keys as id and get to find source and destination, based on parent/…
How to create rectangle using javascript or html
So basically i’m trying to display slots, when the user selects a location and clicks the check slot button . i’m trying to display rectangle when the Check Slot is clicked, similar to the attached image. Please refer the image Image . HTML CODE Answer Use CSS Grid You can use a Grid Layout to dis…
Filter an array of objects by another object of filters
I have an array of objects who follow this structure below: I now want to filter an array of these objects by another object. This filterObject would have the structure below: But this filterObject doesn’t always have all the key-value pairs because they get set manually in the UI. As a result the filte…
Vue 2 : how to select just the search results inside v-data-table
I tried to use select all (as a checkbox) to select all result that what I search for, but it’s still selected all data in table and I use employee.map for loop my selection all data in table. Can somebody help me? here is my code : if there is anything that I did wrong more than what I expected.
Can’t append simple svg to body element
I know this is a super easy question. But I am apparently missing something super obvious. I just want to create an svg element with D3 and see it on my page. My index.htmllooks like this: Whereas my selections.js looks like this: The first console.log() is still visible in the console. But I cant see the svg…
Putting label array to the chartjs?
I have these codes: let arr = []; This is what console.log(arr); shows: [“Item1”, “Item2”, “Item3”, “Item4”] Below is my graph: How can I loop through the object arr to be put inside the labels? Answer The charts label receives a string or an array of strings: S…
Is it normal that I am able to invoke firebase cloud functions from any kind of frontend app?
I am using axios to call the firebase cloud functions I have created with express/firebase. I realized even without using and without importing the firebase and without initializeApp(firebaseConfig) in my frontend, I was able to call my cloud functions with the axios with the following way: How I create cloud…
Weather app with Vue js and Open Weather Map API and 7 day weather forecast
Hi guys I’m trying to build a weather app with a 7 day forecast of a city to be informed by the user. It has to be in Vue js and use the Open Weather Map API. I managed to make the app and connect it to the Open Weather Map API displaying the weather. But I couldn’t display the