mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
1 line
8.5 KiB
JSON
1 line
8.5 KiB
JSON
|
|
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./set-room-owner.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./set-room-owner.page.scss?ngResource\";\nimport { Component } from '@angular/core';\nimport { ModalController, NavParams } from '@ionic/angular';\nimport { ChatSystemService } from 'src/app/services/chat/chat-system.service';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { ToastService } from 'src/app/services/toast.service';\nlet SetRoomOwnerPage = class SetRoomOwnerPage {\n constructor(modalController, navParams, ThemeService, toastService, ChatSystemService) {\n this.modalController = modalController;\n this.navParams = navParams;\n this.ThemeService = ThemeService;\n this.toastService = toastService;\n this.ChatSystemService = ChatSystemService;\n this.textSearch = \"\";\n this.roomId = this.navParams.get('roomId');\n this.members = this.navParams.get('members');\n }\n ngOnInit() {\n // this.chatService.refreshtoken();\n }\n close() {\n var _this = this;\n return _asyncToGenerator(function* () {\n _this.modalController.dismiss();\n })();\n }\n onChange(event) {\n this.textSearch = event.detail.value;\n }\n separateLetter(record, recordIndex, records) {\n if (recordIndex == 0) {\n return record.name[0];\n }\n let first_prev = records[recordIndex - 1].name[0];\n let first_current = record.name[0];\n if (first_prev != first_current) {\n return first_current;\n }\n return null;\n }\n setRoomOwner(user) {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n let res;\n try {\n res = yield _this2.ChatSystemService.addRoomOwner(_this2.roomId, user._id);\n } catch (error) {\n console.error(error);\n }\n if (res.error) {\n if (res.error.error == 'error-user-already-owner') {\n _this2.toastService._badRequest('Este utilizador já é administrador');\n } else {\n _this2.toastService._badRequest('Não foi possível completar a ação, por favor tente novamente.');\n }\n } else {\n _this2.modalController.dismiss('success');\n }\n /*\r\n let body = {\r\n \"roomId\": this.roomId,\r\n \"userId\": user._id\r\n }\r\n this.chatService.addGroupOwner(body).subscribe((res)=>{\r\n this.close();\r\n this.toastService._successMessage('Operação realizada com sucesso');\r\n }, (e) => {\r\n if(e.error.errorType == 'error-user-already-owner'){\r\n this.toastService._badRequest('Este utilizador já é administrador');\r\n }\r\n else{\r\n this.toastService._badRequest('Não foi possível completar a ação, por favor tente novamente.');\r\n }\r\n }); */\n })();\n }\n};\n\nSetRoomOwnerPage.ctorParameters = () => [{\n type: ModalController\n}, {\n type: NavParams\n}, {\n type: ThemeService\n}, {\n type: ToastService\n}, {\n type: ChatSystemService\n}];\nSetRoomOwnerPage = __decorate([Component({\n selector: 'app-set-room-owner',\n template: __NG_CLI_RESOURCE__0,\n styles: [__NG_CLI_RESOURCE__1]\n})], SetRoomOwnerPage);\nexport { SetRoomOwnerPage };","map":{"version":3,"mappings":";;;;AACA,SAASA,SAAS,QAAgB,eAAe;AACjD,SAASC,eAAe,EAAEC,SAAS,QAAQ,gBAAgB;AAC3D,SAASC,iBAAiB,QAAQ,2CAA2C;AAC7E,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,YAAY,QAAQ,gCAAgC;AAOtD,IAAMC,gBAAgB,GAAtB,MAAMA,gBAAgB;EAM3BC,YACUC,eAAgC,EAChCC,SAAoB,EACrBL,YAA0B,EACzBM,YAA0B,EAC3BP,iBAAoC;IAJnC,oBAAe,GAAfK,eAAe;IACf,cAAS,GAATC,SAAS;IACV,iBAAY,GAAZL,YAAY;IACX,iBAAY,GAAZM,YAAY;IACb,sBAAiB,GAAjBP,iBAAiB;IAT1B,eAAU,GAAU,EAAE;IAWpB,IAAI,CAACQ,MAAM,GAAG,IAAI,CAACF,SAAS,CAACG,GAAG,CAAC,QAAQ,CAAC;IAC1C,IAAI,CAACC,OAAO,GAAG,IAAI,CAACJ,SAAS,CAACG,GAAG,CAAC,SAAS,CAAC;EAC9C;EAEAE,QAAQA;IACN;EAAA;EAGIC,KAAKA;IAAA;IAAA;MACTC,KAAI,CAACR,eAAe,CAACS,
|