[ANGULAR] Syncing changes using fake api server using json-server
Posted: Fri Jan 24, 2020 9:17 am
by Dev@2609
Hi Team,
I am trying to sync back the changes using a fake api server (json-server). However I get an error in the success : true flag in the data.json file.
I have installed the json-server from npm and listening to a port, but getting an error to parse the json. Is there any way I can use this to sync changes?
Any help is appreciated
Re: [ANGULAR] Syncing changes using fake api server using json-server
Posted: Fri Jan 24, 2020 1:11 pm
by Dev@2609
Any thoughts?
Re: [ANGULAR] Syncing changes using fake api server using json-server
Posted: Fri Jan 24, 2020 3:35 pm
by mats
Sorry, not clear what you mean with
However I get an error in the success : true flag
What is the problem exactly?
Re: [ANGULAR] Syncing changes using fake api server using json-server
Posted: Fri Jan 24, 2020 3:56 pm
by Dev@2609
I am trying to persist the changes back to the json using npm json-server.
However, the "success" : true flag in the data.json gives me an error
Error: Type of "success" (string) is not supported. Use objects or arrays of objects.
It seems success : true flag in data.json is necessary to populate events on the ui
C:\Aniket\BryntumSchedulerLatest\bryntum-scheduler-trial (2)\scheduler-3.0.1-trial\examples\angular\angular-7\src\assets\data>json-server --watch data.json
\{^_^}/ hi!
Loading data.json
Done
Error: Type of "success" (string) is not supported. Use objects or arrays of objects.
Re: [ANGULAR] Syncing changes using fake api server using json-server
Posted: Sat Jan 25, 2020 1:14 pm
by mats
This is some issue with your backend which you need to debug/understand yourself. Returning "success : true" from a web server should be a very basic task to do.