This commit is contained in:
Troplo 2022-07-29 23:00:41 +10:00
parent 9f3ff615bf
commit d8432f574b
5 changed files with 7 additions and 13 deletions

View file

@ -32,15 +32,9 @@ router.get("/", auth, async (req, res, next) => {
router.post("/", auth, async (req, res, next) => {
try {
const io = req.app.get("io")
let friendRes
try {
friendRes = req.body.friend.split(":")
} catch {
friendRes = req.body.friend
}
const user = await User.findOne({
where: {
username: friendRes[0] || friendRes
username: req.body.friend
}
})
if (user) {

View file

@ -1,6 +1,6 @@
{
"name": "colubrina-chat",
"version": "1.0.2",
"version": "1.0.3",
"private": true,
"author": "Troplo <troplo@troplo.com>",
"license": "GPL-3.0",

View file

@ -38,8 +38,8 @@
</v-tooltip>
<div class="subheading subtitle-1 text--lighten-2">
<template v-if="user.item.nickname"
>{{ user.item.username }}:</template
>{{ user.item.instance }}
>{{ user.item.username }}</template
>
</div>
</v-toolbar-title>
</v-toolbar>

View file

@ -48,8 +48,8 @@ export default {
value: "user.id"
},
{
text: "Sussi Auth ID",
value: "user.sussiId"
text: "Username",
value: "user.username"
},
{
text: "Created At",

View file

@ -306,7 +306,7 @@ export default {
if (user) {
this.axios
.post("/api/v1/friends", {
friend: user.username + ":" + user.instance
friend: user.username
})
.then(() => {
this.getFriends()