collection owner is now visible to other users
This commit is contained in:
@@ -15,14 +15,29 @@ export default async function users(req: NextApiRequest, res: NextApiResponse) {
|
||||
"You are not a subscriber, feel free to reach out to us at hello@linkwarden.app in case of any issues.",
|
||||
});
|
||||
|
||||
const lookupUsername = req.query.username as string;
|
||||
const lookupUsername = (req.query.username as string) || undefined;
|
||||
const lookupId = Number(req.query.id) || undefined;
|
||||
const isSelf = session.user.username === lookupUsername ? true : false;
|
||||
|
||||
if (req.method === "GET") {
|
||||
const users = await getUsers(lookupUsername, isSelf, session.user.username);
|
||||
const users = await getUsers({
|
||||
params: {
|
||||
lookupUsername,
|
||||
lookupId,
|
||||
},
|
||||
isSelf,
|
||||
username: session.user.username,
|
||||
});
|
||||
return res.status(users.status).json({ response: users.response });
|
||||
} else if (req.method === "PUT" && !req.body.password) {
|
||||
const updated = await updateUser(req.body, session.user);
|
||||
return res.status(updated.status).json({ response: updated.response });
|
||||
}
|
||||
}
|
||||
|
||||
// {
|
||||
// lookupUsername,
|
||||
// lookupId,
|
||||
// },
|
||||
// isSelf,
|
||||
// session.user.username
|
||||
|
||||
Reference in New Issue
Block a user