UCRM-plugins icon indicating copy to clipboard operation
UCRM-plugins copied to clipboard

No route found - UCRM Client Signup

Open AlanGreyjoy opened this issue 5 years ago • 10 comments

States are missing from the drop down after choosing a country

error in console No route found for "GET /crm/api/v1.0/countries/249/states""

AlanGreyjoy avatar Oct 11 '19 18:10 AlanGreyjoy

I am also running into this issue, were you able to resolve it?

lootfinder avatar Feb 15 '20 17:02 lootfinder

This is because the route is different between UNMS CRM and the original UCRM

GET /crm/api/v1.0/countries/249/states

would need to be changed to

GET /crm/api/v1.0/countries/states?countryId=249

https://unmscrm.docs.apiary.io/#reference/general/countriesid/get

Because of this, the plugin is not compatible with UNMS CRM

charuwts avatar Feb 15 '20 18:02 charuwts

Thanks. We will make a pull request later or perhaps submit a new plugin for review.

On Sat, Feb 15, 2020, 12:23 PM Brandon [email protected] wrote:

This is because the route is different between UNMS CRM and the original UCRM

GET /crm/api/v1.0/countries/249/states

would need to be changed to

GET /crm/api/v1.0/countries/states?countryId=249

https://unmscrm.docs.apiary.io/#reference/general/countriesid/get

Because of this, the plugin is not compatible with UNMS CRM

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ubiquiti-App/UCRM-plugins/issues/161?email_source=notifications&email_token=AAV2E5RXO7YM6CHFJGWY623RDAXJHA5CNFSM4I75BJX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL3TVKQ#issuecomment-586627754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAV2E5R2DIBPERT33FNVPT3RDAXJHANCNFSM4I75BJXQ .

lootfinder avatar Feb 15 '20 18:02 lootfinder

I updated that block of code and still get the same error states: Ember.computed("model.client.countryId", function() { return 249 == this.get("model.client.countryId") || 54 == this.get("model.client.countryId") ? this.get("ajax").post(t.default.APP.host, { data: { frontendKey: t.default.APP.frontendKey, api: { type: "GET", endpoint: "countries/states?countryId=" + this.get("model.client.countryId"), data: {} } } }) : (this.set("model.client.stateId", null), !1) }),

AlanGreyjoy avatar Feb 24 '20 20:02 AlanGreyjoy

It will need to be updated in the PHP which acts as middleware. The javascript doesn't directly hit that endpoint. @AlanGreyjoy

charuwts avatar Feb 24 '20 22:02 charuwts

@charuwts I can't find that anywhere, in any folder.

When I updated that part in the javascript, it updated in console->network tab. But it says No route found for "GET /crm/api/v1.0/countries/states?countryId=249""

AlanGreyjoy avatar Feb 27 '20 02:02 AlanGreyjoy

GET /crm/api/v1.0/countries/249/states should be GET /crm/api/v1.0/countries/states?countryId=249

They need to update the UCRM API doc as well as its still reflecting the old way.

https://ucrm.docs.apiary.io/#reference/general/countriesidstates/get

Andrewiski avatar May 15 '20 18:05 Andrewiski

Honestly, I rewrote this completely. Ditched ember and used Vue.JS with Vuetify. Now our client signup page is perfect.

AlanGreyjoy avatar May 15 '20 20:05 AlanGreyjoy

Yeah doing the same thing, except ditched plugins as PHP needs to go the way of classic asp. Made a simple Node.js app and wrapped it in a docker container as I needed some sms text messages using AWS and a way to organize the drone 360 views while we are doing client site surveys.

I like the way they exposed the ucms API's but if your going to change them especially something as simple as states leave the old call there or change the endpoint to reflect a new version.

Andrewiski avatar May 15 '20 21:05 Andrewiski

Hey @Andrewiski, the docs are up-to-date, you're just looking in the wrong place. The docs over at https://ucrm.docs.apiary.io/#reference/general/countriesidstates/get are for the legacy UCRM v2. You can find docs for CRM in UNMS v1 at https://unmscrm.docs.apiary.io/#reference/general/countriesstatescountryid/get

keksa avatar May 18 '20 07:05 keksa