Ubiquiti-App / UCRM-plugins

Plugins for UCRM - Complete WISP Management Platform
https://ucrm.ubnt.com/
MIT License
61 stars 102 forks source link

No route found - UCRM Client Signup #161

Open AlanGreyjoy opened 4 years ago

AlanGreyjoy commented 4 years ago

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""

charuwts commented 4 years ago

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

AlanGreyjoy commented 4 years ago

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) }),

charuwts commented 4 years ago

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

AlanGreyjoy commented 4 years ago

@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""

Andrewiski commented 4 years ago

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

AlanGreyjoy commented 4 years ago

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

Andrewiski commented 4 years ago

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.

keksa commented 4 years ago

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