debian-mirror-gitlab/app/assets/javascripts/admin/abuse_reports/index.js
2023-05-27 22:25:52 +05:30

31 lines
715 B
JavaScript

import Vue from 'vue';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import AbuseReportsApp from './components/app.vue';
export const initAbuseReportsApp = () => {
const el = document.querySelector('#js-abuse-reports-list-app');
if (!el) {
return null;
}
const { abuseReportsData } = el.dataset;
const { categories, reports, pagination } = convertObjectPropsToCamelCase(
JSON.parse(abuseReportsData),
{
deep: true,
},
);
return new Vue({
el,
provide: { categories },
render: (createElement) =>
createElement(AbuseReportsApp, {
props: {
abuseReports: reports,
pagination,
},
}),
});
};