@@ -61,13 +106,16 @@ export default {
positions: ['MIA', 'FLL', 'TPA', 'PBI', 'RSW', 'NQX', 'ZMO'],
certs: [],
controllers: null,
- loading: true
- };
+ loading: true,
+ towercerts: []
+ }
},
async mounted() {
await this.getControllers();
await this.getSoloCerts();
+ await this.getLocalCerts();
+
this.loading = false;
M.Tooltip.init(document.querySelectorAll('.tooltipped'), {
@@ -86,12 +134,11 @@ export default {
// Fetch and decode API data.
// The API returns back base 64 encoded data with authentication blocks. The payload needs to be base64 decoded and then parsd for json.
- const {data} = await vatusaApi.get('/solo');
- const payload = atob(data.payload);
- var data1 = JSON.parse(payload);
- for (const cert of data1.data) {
- if(this.positions.includes(cert.position.slice(0, 3)))
- this.certs.push(cert);
+ const {data} = await vatusaApi.get('/solo');
+
+ for (const cert of data.data) {
+ if(this.positions.includes(cert.position.slice(0, 3)))
+ this.certs.push(cert);
}
} catch(e) {
@@ -106,27 +153,44 @@ export default {
console.log(e);
}
},
- async deleteCert(id, cid, position) {
+ async getLocalCerts() {
try {
- const formData = new FormData();
- formData.append('id', id);
-
- // form data seems not to be passed when using the DELETE method. This works only when the ID is passed on the URL.
- await vatusaApiAuth.delete('/solo?id='+id, {data: formData});
+ const {data} = await zabApi.get('/training/solo');
+ for (const user of data.data.users) {
+ this.towercerts.push(user);
+ }
- this.toastSuccess('Solo Certification deleted');
+ } catch(e) {
+ console.log(e);
+ }
+ },
+ async deleteCert(id, cid, position) {
+ try {
+ const {data} = await zabApi.post('/training/solodelete/'+cid, {
+ position: position
+ });
+
+ if (position.slice(-3)==='APP' || position.slice(-3)==='CTR')
+ {
+ await vatusaApiAuth.delete('/solo?id='+id, {
+ id: id
+ });
+ }
+ this.toastSuccess('Solo Certification deleted');
+
this.certs = [];
await this.getSoloCerts();
-
+ await this.getLocalCerts();
+ this.$router.push('/ins/solo');
+ this.$router.go();
this.$nextTick(() => {
M.Modal.getInstance(document.querySelector('.modal_delete')).close();
- });
-
+ });
} catch(e) {
- this.toastError(e);
+ this.toastError(e);
}
- },
+ },
getName(cid2) {
const controller = this.controllers.filter(i => { return i.cid === cid2; });
return controller[0].fname + ' ' + controller[0].lname;
diff --git a/src/views/instructor/solocerts/New.vue b/src/views/instructor/solocerts/New.vue
index 2bb31802..3ce109cc 100644
--- a/src/views/instructor/solocerts/New.vue
+++ b/src/views/instructor/solocerts/New.vue
@@ -14,6 +14,8 @@
Please ensure that the student's training records have been entered onto their ZMA and VATUSA
record prior to issuance of any solo certification.
+ Tier 2 Solo Certifications should be entered as 'TWR', 'APP', or 'CTR'.
+
Ensure that you enter solo certifications into the appropriate system in accordance with section
8.4 of the Miami ARTCC SOP. The student cannot take advantage of solo certifications that are
not entered correctly.
@@ -28,9 +30,17 @@