Skip to content

Commit 3bb2f91

Browse files
committed
fix(router): redirect profile details view to internal contacts list
Signed-off-by: silver <s.szmajduch@posteo.de> Assisted-by: ClaudeCode:claude-sonnet-5
1 parent 961dceb commit 3bb2f91

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/router/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
*/
55

66
import { generateUrl } from '@nextcloud/router'
7+
import { Buffer } from 'buffer'
78
import { createRouter, createWebHistory } from 'vue-router'
89
import Contacts from '../views/Contacts.vue'
9-
import { ROUTE_CHART, ROUTE_CIRCLE, ROUTE_USER_GROUP } from '../models/constants.ts'
10+
import { GROUP_ALL_CONTACTS, ROUTE_CHART, ROUTE_CIRCLE, ROUTE_USER_GROUP } from '../models/constants.ts'
1011

1112
// if index.php is in the url AND we got this far, then it's working:
1213
// let's keep using index.php in the url
@@ -57,6 +58,17 @@ export default createRouter({
5758
name: 'user_group',
5859
component: Contacts,
5960
},
61+
{
62+
path: 'u/:userId',
63+
name: 'profile-redirect',
64+
redirect: (to) => ({
65+
name: 'contact',
66+
params: {
67+
selectedGroup: GROUP_ALL_CONTACTS,
68+
selectedContact: Buffer.from(`${to.params.userId}~z-server-generated--system`, 'utf8').toString('base64'),
69+
},
70+
}),
71+
},
6072
],
6173
},
6274
],

0 commit comments

Comments
 (0)