mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
Finish get single and delete api for sessions
This commit is contained in:
1 parent
43f54b4f93
commit
5410254ee0
1 file changed
+2
-2
@@ -38,7 +38,7 @@ export async function createSession(req, res) {
|
|||||||
export async function getSessionById(req, res) {
|
export async function getSessionById(req, res) {
|
||||||
try {
|
try {
|
||||||
const session = await Session.findOne({
|
const session = await Session.findOne({
|
||||||
_id: req.params.session_id,
|
_id: req.params.id,
|
||||||
user: req.user.id,
|
user: req.user.id,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ export async function getSessionById(req, res) {
|
|||||||
export async function deleteSessionById(req, res) {
|
export async function deleteSessionById(req, res) {
|
||||||
try {
|
try {
|
||||||
const session = await Session.findOneAndDelete({
|
const session = await Session.findOneAndDelete({
|
||||||
_id: req.params.session_id,
|
_id: req.params.id,
|
||||||
user: req.user.id,
|
user: req.user.id,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user