diff options
Diffstat (limited to 'app/assets/javascripts/admin/abuse_report/index.js')
-rw-r--r-- | app/assets/javascripts/admin/abuse_report/index.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/assets/javascripts/admin/abuse_report/index.js b/app/assets/javascripts/admin/abuse_report/index.js new file mode 100644 index 00000000000..8ff3e690127 --- /dev/null +++ b/app/assets/javascripts/admin/abuse_report/index.js @@ -0,0 +1,27 @@ +import Vue from 'vue'; +import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; +import AbuseReportApp from './components/abuse_report_app.vue'; + +export const initAbuseReportApp = () => { + const el = document.querySelector('#js-abuse-reports-detail-view'); + + if (!el) { + return null; + } + + const { abuseReportData } = el.dataset; + const abuseReport = convertObjectPropsToCamelCase(JSON.parse(abuseReportData), { + deep: true, + }); + + return new Vue({ + el, + name: 'AbuseReportAppRoot', + render: (createElement) => + createElement(AbuseReportApp, { + props: { + abuseReport, + }, + }), + }); +}; |