mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Use slugs instead of names for mentions
This commit is contained in:
parent
7492e6b8c3
commit
f5cf3d9b68
@ -132,9 +132,8 @@ export default {
|
|||||||
User: {
|
User: {
|
||||||
query() {
|
query() {
|
||||||
return gql(`{
|
return gql(`{
|
||||||
User(orderBy: name_asc) {
|
User(orderBy: slug_asc) {
|
||||||
id
|
id
|
||||||
name
|
|
||||||
slug
|
slug
|
||||||
}
|
}
|
||||||
}`)
|
}`)
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
:class="{ 'is-selected': navigatedUserIndex === index }"
|
:class="{ 'is-selected': navigatedUserIndex === index }"
|
||||||
@click="selectUser(user)"
|
@click="selectUser(user)"
|
||||||
>
|
>
|
||||||
{{ user.name }}
|
@{{ user.slug }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div
|
<div
|
||||||
@ -287,7 +287,7 @@ export default {
|
|||||||
}
|
}
|
||||||
const fuse = new Fuse(items, {
|
const fuse = new Fuse(items, {
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
keys: ['name']
|
keys: ['slug']
|
||||||
})
|
})
|
||||||
return fuse.search(query)
|
return fuse.search(query)
|
||||||
}
|
}
|
||||||
@ -360,7 +360,7 @@ export default {
|
|||||||
attrs: {
|
attrs: {
|
||||||
// TODO: use router here
|
// TODO: use router here
|
||||||
url: `/profile/${user.id}`,
|
url: `/profile/${user.id}`,
|
||||||
label: user.name
|
label: user.slug
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.editor.focus()
|
this.editor.focus()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user