debian-mirror-gitlab/app/assets/javascripts/users/profile/index.js
2023-04-23 21:23:45 +05:30

23 lines
566 B
JavaScript

import Vue from 'vue';
import ReportAbuseButton from './components/report_abuse_button.vue';
export const initReportAbuse = () => {
const el = document.getElementById('js-report-abuse');
if (!el) return false;
const { reportAbusePath, reportedUserId, reportedFromUrl } = el.dataset;
return new Vue({
el,
name: 'ReportAbuseButtonRoot',
provide: {
reportAbusePath,
reportedUserId: parseInt(reportedUserId, 10),
reportedFromUrl,
},
render(createElement) {
return createElement(ReportAbuseButton);
},
});
};