(code, opts)
| 57 | } |
| 58 | |
| 59 | joinWithCode (code, opts) { |
| 60 | let url |
| 61 | if ((code.length === 14) && (code.split('-').length === 3)) { |
| 62 | url = this.urlRoot + '/join-by-activation-code' |
| 63 | } else { |
| 64 | url = this.urlRoot + '/~/members' |
| 65 | } |
| 66 | const options = { |
| 67 | url, |
| 68 | type: 'POST', |
| 69 | data: { code }, |
| 70 | success: () => this.trigger('join:success'), |
| 71 | error: () => this.trigger('join:error') |
| 72 | } |
| 73 | _.extend(options, opts) |
| 74 | return this.fetch(options) |
| 75 | } |
| 76 | |
| 77 | fetchByCode (code, opts) { |
| 78 | const options = { |
no test coverage detected