doesn't need to be a public route (should go behind usual API auth)

This commit is contained in:
Harrison Rose 2024-07-22 23:14:50 -05:00
parent a8081b9a74
commit 4cdf54d049

View file

@ -238,10 +238,9 @@ class ShareController {
res.sendStatus(204) res.sendStatus(204)
} }
/** /**
* Public route
* GET: /api/share/mediaitem/:id * GET: /api/share/mediaitem/:id
* get existing share from mediaItemId * get existing share from mediaItemId
* (or would it be better to return just the slug?) * (or would it be better to return just the slug instead of whole share object?)
* *
* @param {import('express').Request} req * @param {import('express').Request} req
* @param {import('express').Response} res * @param {import('express').Response} res
@ -261,6 +260,7 @@ class ShareController {
if (existingMediaItemShare) { if (existingMediaItemShare) {
return res.status(200).json(existingMediaItemShare.toJSONForClient()); // or would it be better to return just the slug? return res.status(200).json(existingMediaItemShare.toJSONForClient()); // or would it be better to return just the slug?
//return res.status(200).json(existingMediaItemShare.slug.toJSONForClient());
} else { } else {
return res.status(404).send('Share not found'); return res.status(404).send('Share not found');
} }