Issue I started developing a web-app with angularJS and I’m not sure that everything is right secured (client and server side). Security is based on a single login page, if credentials are checked ok, my server sends back an unique
Continue readingTag: rest
Call REST repeatedly in Angular (5)
Issue I need create service which will be consume data from long-polling rest service in my backend. When I call this service, backend wait until it has data to send or timeout is expired and send just empty object. In
Continue readingCall REST repeatedly in Angular (5)
Issue I need create service which will be consume data from long-polling rest service in my backend. When I call this service, backend wait until it has data to send or timeout is expired and send just empty object. In
Continue readingWhat is a RESTful way of monitoring a REST resource for changes?
Issue If there is a REST resource that I want to monitor for changes or modifications from other clients, what is the best (and most RESTful) way of doing so? One idea I’ve had for doing so is by providing
Continue readingHow to implement Long Polling REST endpoint in Spring Boot app?
Issue Would you be so kind as to share any up-to-date manual or explain here how to implement a REST Long Polling endpoint with the latest Spring (Spring Boot)? Everything that I’ve found by this time is quite out-dated and
Continue readingWhy SOAP can't use HTTP caching mechanisms
Issue I am making a transition from SOAP to REST, and I would like to convince my colleagues that this is a good move. We don’t need the extra security mechanisms that SOAP can provide. For us the overhead of
Continue readingHow to use CXF, JAX-RS and HTTP Caching
Issue The CXF documentation mentions caching as Advanced HTTP: CXF JAXRS provides support for a number of advanced HTTP features by handling If-Match, If-Modified-Since and ETags headers. JAXRS Request context object can be used to check the preconditions. Vary, CacheControl,
Continue readingReST low latency – how should I reply to a GET while an upload is pending?
Issue I am designing a ReST API which follows the basic CRUD pattern. My API can receive a request to update a resource which may take a short time to process. Ideally I would like to inform clients that a
Continue readingServiceStack/TypeScript: The typescript-ref ignores namespaces (this causing duplicates)
Issue I am learning NativeScript + Angular2 with ServiceStack in C# as the backend. For the app, I generated TypeScript classes using the typescript-ref command, for use with the JsonServiceClient in ServiceStack: >typescript-ref http://192.168.0.147:8080 RestApi It all looked sweet and
Continue readingHow to Dynamically Create and Expose a New REST Endpoint In Code (on the fly) for a Custom Loopback Model
Issue We’re developing a SaaS accounting product that uses the Loopback REST framework and allows authenticated end users to create new tables in their own database instance (MySQL or PostgreSQL). QUESTION: How can we create a new root level Looback
Continue readingHow to Dynamically Create and Expose a New REST Endpoint In Code (on the fly) for a Custom Loopback Model
Issue We’re developing a SaaS accounting product that uses the Loopback REST framework and allows authenticated end users to create new tables in their own database instance (MySQL or PostgreSQL). QUESTION: How can we create a new root level Looback
Continue readingStrongloop AngularJS reflection services
Issue I’ve a Java developer who’s begun working in the Javascript enterprise domain. Specifically I’ve begun working with Strongloop/Loopback API and AngularJS in the client. I’m creating entities with ease with Strongloop and am very impressed with how quickly I
Continue readingHow can i get users details from MySql connector in the strongloop & remove "Authorization Required"
Issue I’m trying to connect strongloop to MySql DB using connector, I’m able to get record of all the tables except “Users” which is having following details as [ { “userEmailId”: “string”, “userPassword”: “string”, “firstname”: “string”, “lastname”: “string”, “roleId”: 0,
Continue readingHow can i create web services using MySql Stored procedures in strongloop
Issue I’m new to concept of strong loop & want to create web services using MySql stored procedures instead of table schema, but i’m not getting any related samples or step by step documentation for how & where to define
Continue readingHow to hide an specific field from result in strongloop
Issue I’m trying to create an project using strongloop, in which I’m creating an web service for user login, My code runs well & gets desired output except the fact that it does not hide password I’m getting result as
Continue readingInconsistent Results Using Loopback Count End-Point With Filter+Where vs. Just Where
Issue We’re getting unexpected and inconsistent results when using Loopback’s count end-point. Using filter[where] always returns the total number of rows in the table, ignoring any filter. For example, the following call always returns a value of 9 which is
Continue readingHow to include and order an array using the Strongloop Loopback REST API?
Issue I have am including an array in an existing model, by adding the terms {“include” : [“answers”]} in a model called User/Questions. Therefore, if I get the User/Questions model I will get a list of answers. However, now I
Continue readingLoopback REST connector, data mapping response to model?
Issue I’ve setup a simple “product” model (ie {id:”string”,”name”:string, etc}) and setup a datasource using the REST connector to a remote URL that returns a JSON blob containing dozens of fields, how do I go about mapping the fields from
Continue readingIncrement a field in model using remote method in loopback?
Issue There is a field called counter in a model and whenever if I call a custom remote method like Request URL http://loopback:3000/api/models/increment_counter Request body EMPTY Response { “counter” : [Value after Increment] } Currently to increment First i have
Continue readingQuery Reference/lookup values in LoopBack
Issue How do you query reference/lookup data and what is the correct relation to build between models to support them? Example: Address model has a field that represents the city the address is located. A city model has a pre-populated
Continue readingLoopback Login a user with REST as datasource
Issue I have a UserModel that has a base model USER and a REST datasource “UserModel”: { “dataSource”: “mock”, “public”: true } Data Source “mock”: { “name”: “mock”, “baseURL”: “http://localhost:3000/”, “connector”: “rest” }, The UserModel { “name”: “UserModel”, “base”: “User”,
Continue readingStrongloop API response limit over Oracle Database
Issue I’ve just started using Strongloop to define a REST api over my oracle database. Everything works fine when I check my API using “localhost:3000/explorer”. For instance, when I send a “get” to list all persons, the server answers with
Continue readingDuplicate keys in a REST connector query in loopback
Issue I would like to ask if you know how could I duplicate parameters in a loopback REST connector query. I have the following code: details: { ‘template’: { ‘method’: ‘GET’, ‘debug’: true, ‘url’: ‘https://www.example.com/data’, ‘timeout’: 10000, ‘headers’: { ‘Authorization’:
Continue readingHow to make API rate limit policy in loopback
Issue I just want to make an API requests rate limiting per account plan so let’s say that we have users and every user have a plan that has some limits of how many API requests per day they can
Continue readingLoopBack filter "where and " return wrong/same result in any value
Issue This is what in loopback docs said about using and operators rest: ?filter[where][and][0][title]=My%20Post&filter[where][and][1][content]=Hello I tried: count?filter{“where”:[{“and”}[{“user_id”:”5a6840ddb2b58b07cca3c680″},{“post_id”:”4444″}]} //post_id:4444 is not exit and count?filter[where][and][0][user_id]=”5a6840ddb2b58b07cca3c680″&filter[where][and][1][post_id]=”5a6253bdcf975122dcf11dd8″ and many other forms but the result is count: 12 but should return 0 in 4444 or
Continue readingLoopBack: How to Dynamically Create Custom REST Endpoints In Code (On The Fly)
Issue We are using the LoopBack REST framework to expose our database (and business logic). We need to allow our customers to create custom tables in the database (single and multi-tenant) which can be accessed via a REST endpoint. All
Continue readingHow to change http status codes in Strongloop Loopback
Issue I am trying to modify the http status code of create. POST /api/users { “lastname”: “wqe”, “firstname”: “qwe”, } Returns 200 instead of 201 I can do something like that for errors: var err = new Error(); err.statusCode =
Continue readingHow to programmatically detach a model from a loopback application?
Issue I am using loopback without the strongloop framework itself, meaning I have no access to any of the cli tools. I am able to succesfully create and launch a loopback server and define/load some models in this fashion: var
Continue readingHow to Query MySQL JSON Field Values with a Loopback REST API Filter
Issue What’s the proper Loopback filter format to query a value in a MySQL (5.7) JSON field? For example, how would we perform this query using a Loopback REST filter? QUERY SELECT name, info->”$.id”, info->”$.team” FROM employee WHERE JSON_EXTRACT(info, “$.team”)
Continue readingWhy does my angular resource ignore the action-specific url?
Issue I have the following angular code: var app = angular.module(‘app’, [‘ngResource’]); app.factory(‘Post’, function ($resource) { return $resource(‘/post’, {}, { query: { method: ‘GET’, url: ‘/post/get/:id’, params: { id: ‘@id’ } }, save: { method: ‘POST’, url: ‘/post/addorupdate/:id’, params: {
Continue readingAngularJS $resource – 414 Request-URI Too Large
Issue I use AngularJS $resource to save large objects. Everything worked good, until object became really large. angular.module(‘Test.services’).factory(‘TestService’, function($resource) { return $resource( ‘/MyRestURL/:id’, { id: “@id” }, { save : { method: ‘POST’, isArray: false, params: { data: “@data” }
Continue readingProviding a RESTful service with ASP.NET MVC for AngularJS
Issue I’m using the $resource object in AngularJS. Since it has a single URL for all REST calls, what should I provide on the ASP.NET MVC server side for each of the inbuilt calls (get, delete etc.)? $resource.get and $resource.delete
Continue readingBatch update, create and delete the REST way
Issue Using Tastypie and AngularJS $resource I would like to perform a set of update, create and delete operations. Currently, I broadcast an event: $rootScope.$broadcast(‘save’); That event is captured by each controller responsible for creating, updating and deleting using the
Continue readingGetting nested object data when querying and getting from resource
Issue I designed a RESTful web API that has an endpoint that outputs objects in this structure: { “id”: 2, “name”: “Test Object”, “owner”: 3, } The “owner” is also represented by a separate API endpoint which gives more data
Continue readingAngularJS REST resource – refresh query
Issue How can I refresh query result of $resource in AngularJS without refreshing the page? My page: <div class=”container” ng-controller=”AppController”> <div ng-repeat=”tile in items”> <p>{{tile.name}}</p> </div> <button ng-click=’??’> Reload tiles </button> </div> Controller: (function(angular) { var AppController = function($scope, Item)
Continue readingUsing an embedded resource URL in AngularJS $resource
Issue So, I have a REST resource along these lines… /api/Dogs /api/Dogs/1 /api/Dogs/2 … Where a Dog looks like… { Id: 1, Url: “http://kennelclub/api/Dogs/1”, Name: “Butch” } and a second resource like so… /api/Owners /api/Owners/1 …. As a convenience, to
Continue readingAngularJS $resource DELETE item in collection
Issue I have an ASP.NET Web Api (1) controller with GET, POST and DELETE actions. I am calling this from an Angular 1.2.0 RC3 app with $resource. Let’s call the controller Foos. I do a GET that returns a list
Continue readingUsing $resource with rest service
Issue I’m trying to get familiar with $resource in order to use RESTful Web Services. So, for the attempt, I declared a factory like this : ‘use strict’; angular.module(‘BalrogApp’).factory(‘Req’, [‘$resource’, function($resource) { return $resource(‘http://localhost:8000/api/catalog/requests/:id’, {id: ‘@id’}, { ‘update’: { method:
Continue readingGet response header in then() function of a ngResource object's $promise property after resource resolved?
Issue I’m willing to retrieve the response header of a resource request, cause I’ve put pagination information and something else in it rather than the response body, to make the REST api clear. Though we can get it from the
Continue readingangularjs DELETE array of objects
Issue Please help me understand: why angularjs not delete array of objects $scope.removeAll = function( all = _.pluck($scope.uploader.queue, ‘file’); all.length && HTTPStorage.query_delete(all, function () { $scope.uploader.clearQueue(); delay.resolve(); }); ) service: services.factory(‘HTTPStorage’, [‘$resource’, function($resource){ return $resource(‘/api/v1/documents/storage/:id’, {‘id’: ‘@id’},{ ‘query_delete’: { method:
Continue readingHow to pass body payload to angular $resource DELETE call
Issue I have standard angular $resource configured as such angular.module(‘client.resources’) .factory(‘ProjectSubjectResource’,[‘$resource’, function ($resource) { release: { method: ‘DELETE’, isArray: false } }); }]); and I am calling this method as ProjectSubjectResource.release({projectId: projectId, subjectId: 0},{ subjectIds: subjectIdArray}) where subjectIdArray is array
Continue readingHowto update an ARGO-CD parameter via REST-API?
Issue I found the swagger-ui. But the only functionality I can imagine to do this job (I found) was the application patch method (swagger-ui#operation/Patch). But I find no explenation how to do it. The explenation I found is for the
Continue readingCan't import `configureRepositoryRestConfiguration` in Spring
Issue I have extended my class from RepositoryRestMvcConfiguration according to documentation it has configureRepositoryRestConfiguration method which can be implemented but when I try to override this method I can’t import it 😐 Can anybody tell me Why this problem occurred?
Continue readingAngularJS 1.6 Upgrade code to login no longer working with REST?
Issue I had a project using AngularJS 1.5.8 and the login method worked as followed: $scope.login = function() { // creating base64 encoded String from user name and password var base64Credential = btoa($scope.username + ‘:’ + $scope.password); // calling GET
Continue readingSign-up/Sign-in between SPA and a REST API with OpenID Connect
Issue Consider: An SPA or a statically generated JAMStack website (written in Vue/Nuxt). A REST API (Node + Express) running in the cloud. The website is being served through a CDN. We are required to add a Social Sign-On functionality
Continue readingHow to extract authentication token in @Controller
Issue I have Spring Boot app that uses OAuth 2.0 and Authorization Server. When I try to access a secured page, I get a redirect to the login page of my authorization server (Blitz Identity Provider) and everything works like
Continue readingUsing RestTemplate GET request throws 400 Bad Request
Issue I am getting 400 Bad Request when I send a GET request to Rest Service from JUnit Test case. My request body should be text/plain (Content-Type: text/plain) and the response should be a ResponseEntity of type Employee. I am
Continue readingGet list of all the Project collection Admins for an organisation in azure devops
Issue I want to list all the users in Project collection admin group in Azure devops. I am able to retrieve the list of users who are directly added and the users who are added through aad groups. But, I
Continue readingHow to get Restangular to PUT without ID?
Issue I’m working on the front-end for a web application that has a somewhat unorthodox “RESTful” back-end. The CRUD actions look like this: model GET :id POST {payload} PUT {payload} DELETE :id In other words, the PUT action does not
Continue readingLaravel Restful Resource controller & restangular
Issue We have a Laravel 5.1 Restful Resource Controller (Let’s say FooController) with all methods using route api/foo/6/edit We also have an Angular.js front-end app which uses restangular module to communicate with back-end. However, when we try to post the
Continue readingHow to implement Restangular in a MEAN.js application?
Issue I would like to figure out how to implement Restangular in my mean.js application, i’m doing the routing with angular.js, and i’m using espress.js for the RESTAPI, what i want is to consume the API with Restangular. These are
Continue readingChange restangular url so that it doesn't go to a concatenation of localurl+serverurl?
Issue When I try to run the command: return Restangular.one(‘me’).get(); I get the following response GET http://localhost:8100/serverurl:8666/api/v1/me 404 (Not Found) How do I change so that all requests use the url below instead, and where in my code should I
Continue readingGet result of rest request instead of response?
Issue I have the following function in my controller. RestRequestsSrvc.getUserDetail() .then( function (response) { $scope.user.userDetail = response; }, function (error) { // TODO }); If I type console.log(RestRequestsSrvc.getUserDetail()); the console logs a promise. I want to set a variable the
Continue readingValidation of objects/forms sent via AngularJS to Symfony2 REST API
Issue I’m using AngularJS with Restangular library to handle Rest Api written in Symfony2 + JMS Serializer + FOS Rest Bundle. In order to perform CRUD operations on User Entity first I get particular User to display: var User =
Continue readingCustomising the API mapping for ng-admin, need a function to change "id" to "_id"
Issue Currently I am using ng-admin to build an admin panel for my webapp. http://ng-admin-book.marmelab.com/doc/API-mapping.html This link talks about API mapping and the JSON response expected when ng-admin uses a GET request to get data. The JSON response format is
Continue readingPlay-Rest API with Java – basic response
Issue I’m new in the server-side , and I’m trying to learn how to use play in rest api with java and restangular. I made a project for java in the intellij. I want the GET request to return an
Continue readingFilter cached REST-Data vs multiple REST-calls
Issue I’m building an Angular Shop-Frontend which consumes a REST-API with Restangular. To get the articles from the API, I use Restangular.all(“articles”) and I setup Restangular to cache this request. When I want to get one article from the API,
Continue reading"bound m" show in angular ng-repeat
Issue I use restangular to connect to REST API. I define a ProductService.js with this code: ‘use strict’; angular.module(‘app’).service(‘ProductService’, function($rootScope, Restangular) { // Build collection /product URL var _productService = Restangular.all(‘product’); this.list = function() { // GET /api/product return _productService.getList();
Continue readingConverting $http.get to Restangular
Issue Alrighty, for an internship project I am trying to create a simple client for a REST API. The current client is using regular angularJS, but I need to use Restangular for this. I have been searching around a lot,
Continue readingRestangular getList() returning empty array
Issue I am trying to invoke a Java REST API from Angular JS using Restangular. I am able to see proper response in the network tab but the response object is having empty array while i try to log the
Continue readingIs it possible to use RestAngular.setBaseUrl for two api access points?
Issue Is it possible to work with Restangular with 2 different APIs? I would like to have setBaseUrl() for both. Solution just create two or more Restangular service and config them as you want and inject your module which one
Continue readingCommon POST Function for Angular through Services
Issue We are building an angular app which is having multiple functions based on GET, POST and PUT methods. For Example this.updateEmp = function (employee) { var response = $http({ method: “post”, url: “Home/UpdateEmployee”, data: JSON.stringify(employee), dataType: “json” }); return
Continue readingPass user context id as header to rest API
Issue I have 2 applications – a laravel rest API and angular front end which are on 2 different domains. It is a multi tenant app where users can belong to one or more organisations and can switch between orgs
Continue readingHow to send a resource collection using Restangular?
Issue Let’s say I want to send a DELETE request to a resource like /products and I want to delete multiple products. The whole request would be to the following URI: /products/ids=1&ids=2&ids=3 How can I issue a request like the
Continue readingAngularJs, Django RESTful and Restangular: Consuming an array of hyperlinks
Issue I’m having trouble configuring restangular to consume a list of api urls in my response object. Currently, my object response looks like: { folders: [‘http://localhost:8000/api/folder/1’, ‘http://localhost:8000/api/folder/2’, ‘http://localhost:8000/api/folder/3’] } but i want it to return the folder objects { folders:
Continue readingBest practice of RestAngular
Issue So I’ve started to work on an own project, where I’m in the middle of developing the front-end of my website. I started out with an PHP Laravel back-end and I’ve setted up an API service for my database.
Continue readingPrevent encode the rest call with post Method in Angular js
Issue I am using angular js and making a restcall. But I have one variable and this variable have some value when I put this variable in service then this variable value encoded in console. REST CALL var rep =
Continue readingGetting cleaner code for multiple HTTP GET requests with angularjs
Issue I have been pondering over the 3 approaches to make HTTP GET REST calls with angularjs. They are $http, ngResource and restangular. I settled on $http because it is simplest and leads to the most readable code. However, my
Continue readingRestangular not setting headers on post
Issue I am trying to set the header for a single post request using restangular but the request is being sent as plain text instead of json. I have read the documentation here as well as a similar question. I
Continue readingSending a Restangular DELETE or customDELETE with a body
Issue when I hit the api with: how can I hit the api (not from the angular app) with: apiadress/endpoint/idnumber/?param=param with a DELETE, everything works fine and as expected. but When I do so from Restangular like this: Restangular.one(“endpoint”).customDELETE(idnumber,params) I
Continue readingIs there any restful api for postgresql?
Issue Im trying to develop a web app using angularjs, restangular and postgresql, im using ubuntu and xampp for development. I found ArrestDB, a restful api for postgresql. In its documentation, # Get all rows from the “customers” table where
Continue readingUsing a full URL with Restangular
Issue I like all of the functions of Restangular for AngularJS, except that I can’t find (and it may not support) a way of just passing a full URL to it. I realize the benefit of the .one(‘something’,’someparam’) but my
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingCorrect/best way to return a collection from a REST API
Issue Ok so here’s my dilemma (sorry for the long explanation, just trying to be as clear as I can for this case). I am working on a RESTful API made with Play Framework. The thing is that I found
Continue readingHow to use ng2-bootstrap Typahead with REST backend
Issue How do I do a typeahead with a REST service as source in Typescript? Do I need to use a promise or can I use observables? Specifically I am looking for what I need in the getAsyncData() function from
Continue readingHow to make SoapUI json request work with german umlauts?
Issue We use SoapUI for many interfaces in our team project. We came across a problem with german special signs, called umlauts. When sending a POST request with Json body and a german umlaut, the we get com.fasterxml.jackson.databind.JsonMappingException. It cannot
Continue readingSFDC Mobile SDK API Call – Request Timeout
Issue Hybrid Mobile App Cordova 8.0.0 Angular 1.7.5 Salesforce MobileSDK 6.2 Method – force.apexrest Issue – Salesforce REST API Call – Request Timeout (20%). Details – When the mobile app is hitting an SFDC custom REST API then sometimes it
Continue readingHow to make a web api call to propublica.org from angular service
Issue I’m trying to use get information from propublica.org’s congress api from an Angular 8 service. Being new to Http calls to an external web api, I’m struggling with reading the documentation found here: https://projects.propublica.org/api-docs/congress-api/#requests The best thing I could
Continue readingRegistration Form REST API Best Practices
Issue I’m building a SaaS application using the MEAN stack and have a few questions regarding how best to secure registration forms. Express.js is what I’m using to generate the endpoints (via angular-fullstack) I have “tenants” that register using a
Continue readinghow to retrieve data form the server in angular
Issue I’m trying to build my first web application using angular and Nestjs. when I try to get data from the server error was shown in the browser console. any help with that please. core.js:4081 ERROR TypeError: this.books is not
Continue readingReact with TypeScript using tsyringe for dependency injection
Issue I am currently having trouble with my React TypeScript project. I created my project with npx create-react-app my-app –template typescript. I recently added tsyringe for dependency injection and was trying to implement it for an apiService. After following the
Continue readingDiscord.js not registering new slash commands because application names must be unique
Issue Discord.js won’t register my commands again, despite the fact they don’t exist. I’ve verified that the commands don’t exist by running: rest.get(Routes.applicationCommands(clientId)) .then(data => console.log(data)); with the only response being [] The error I get is this: DiscordAPIError[50035]: Invalid
Continue readingTypeORM: update item and return it
Issue As far as I know, it’s a best practice to return an item after it has been updated. TypeORM’s updateById returns void, not the updated item though. My question: Is it possible to update and return the modified item
Continue readingCatching errors in Angular HttpClient
Issue I have a data service that looks like this: @Injectable() export class DataService { baseUrl = ‘http://localhost’ constructor( private httpClient: HttpClient) { } get(url, params): Promise<Object> { return this.sendRequest(this.baseUrl + url, ‘get’, null, params) .map((res) => { return res
Continue readingHow can I query my database and return all user documents?
Issue I’m trying to test an API that returns all user documents in Mongo DB, however it keeps returning an empty result. I can’t seem to figure out where my code is going wrong. here’s my user model const mongoose
Continue readingDownload zip file using Angular
Issue It has been hours now, since I am trying to figure out how to download a zip file using Angular. The file downloaded is smaller than the original file. I followed this link How do I download a file
Continue readingHow do I update a document in MongoDB using Mongoose
Issue I am creating a Car Booking Service. Here is the code for car Model. const mongoose = require(‘mongoose’); const CarSchema = new mongoose.Schema({ Name: { type: String, required: true }, Model: { type: String, required: true }, Year: {
Continue readingIs there a way to call API not on client side?
Issue Currently in my site, the API Call is in the client-side JavaScript meaning that anyone can spam refresh and use up the limited amount of API Calls (At least I assume that is how it works). I am new
Continue readingI get colon with my param using express for node.js
Issue Here’s my routing : router.route(‘/search:word’).get(function(req, res) { var re = new RegExp(req.params.word, ‘i’); console.log(req.params.word); Place.find().or([{ ‘title’: { $regex: re }}, { ‘category’: { $regex: re }}]).sort(‘title’).exec(function(err, places) { res.json(JSON.stringify(places)); }); }); When I use the request /places/search:test the console
Continue readingOneSignal Notifications delay
Issue I have an ionic 2 app running on android with a wordpress site providing the data. I have notifications working with onesignal. The problem is that the notification arrives before the rest API data is updated. The App can
Continue reading