Files
Modrinth-plus/apps/frontend/src/utils/report-helpers.ts

23 lines
537 B
TypeScript
Raw Normal View History

2026-04-04 13:33:09 -07:00
export const getReportPath = (type: string, id: string) => {
const prefill = new URLSearchParams()
prefill.set('item', type)
prefill.set('itemID', id)
2026-04-04 13:33:09 -07:00
return '/report?' + prefill.toString()
}
2026-04-04 13:33:09 -07:00
const startReport = (type: string, id: string) => {
navigateTo(getReportPath(type, id))
}
export const reportProject = (id: string) => {
return startReport('project', id)
}
export const reportVersion = (id: string) => {
return startReport('version', id)
}
export const reportUser = (id: string) => {
return startReport('user', id)
}