Hacky way of implementing a Share endpoint

This commit is contained in:
CenTdemeern1 2025-01-24 18:44:31 +01:00
parent 2086522d64
commit 405158d280
2 changed files with 19 additions and 0 deletions

View file

@ -24,6 +24,7 @@ import ListEdit from 'components/list_edit/list_edit.vue'
import AnnouncementsPage from 'components/announcements_page/announcements_page.vue'
import RegistrationRequestSent from 'components/registration_request_sent/registration_request_sent.vue'
import AwaitingEmailConfirmation from 'components/awaiting_email_confirmation/awaiting_email_confirmation.vue'
import Share from '../components/share/share.js'
export default (store) => {
const validateAuthenticatedRoute = (to, from, next) => {
@ -71,6 +72,7 @@ export default (store) => {
{ name: 'friend-requests', path: '/friend-requests', component: FollowRequests, beforeEnter: validateAuthenticatedRoute },
{ name: 'notifications', path: '/:username/notifications', component: Notifications, props: () => ({ disableTeleport: true }), beforeEnter: validateAuthenticatedRoute },
{ name: 'login', path: '/login', component: AuthForm },
{ name: 'share', path: '/share', component: Share, beforeEnter: validateAuthenticatedRoute },
{ name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) },
{ name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) },
{ name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute },

View file

@ -0,0 +1,17 @@
// This entire file is basically a hack to make the
// "preset" functionality of post_status_form work
import { h, resolveComponent } from "vue"
import PostStatusForm from "../post_status_form/post_status_form.vue"
const Share = {
name: 'Share',
render () {
return h(resolveComponent('PostStatusForm'))
},
components: {
PostStatusForm
}
}
export default Share