(name, done)
| 232 | } |
| 233 | |
| 234 | static getUnconflictedName (name, done) { |
| 235 | // deprecate in favor of @checkNameConflicts, which uses Promises and returns the whole response |
| 236 | return $.ajax(`/auth/name/${encodeURIComponent(name)}`, { |
| 237 | cache: false, |
| 238 | success (data) { return done(data.suggestedName) }, |
| 239 | }, |
| 240 | ) |
| 241 | } |
| 242 | |
| 243 | static checkNameConflicts (name) { |
| 244 | return new Promise((resolve, reject) => $.ajax(`/auth/name/${encodeURIComponent(name)}`, { |