fix error preventing subscriptions
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
24b8b172b9
commit
3b69d76525
|
@ -5,7 +5,7 @@ module.exports = Self => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const userId = ctx.options.accessToken.userId;
|
const userId = ctx.options.accessToken.userId;
|
||||||
const user = await ctx.instance.userFk;
|
const user = await ctx.instance.userFk;
|
||||||
const modifiedUser = await getUserToModify(user, models);
|
const modifiedUser = await getUserToModify(null, user, models);
|
||||||
|
|
||||||
if (userId == modifiedUser.id || userId == modifiedUser.bossFk)
|
if (userId == modifiedUser.id || userId == modifiedUser.bossFk)
|
||||||
return;
|
return;
|
||||||
|
@ -40,7 +40,7 @@ module.exports = Self => {
|
||||||
Self.deleteNotification = async function(ctx, notificationId) {
|
Self.deleteNotification = async function(ctx, notificationId) {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const user = ctx.req.accessToken.userId;
|
const user = ctx.req.accessToken.userId;
|
||||||
const modifiedUser = await getUserToModify(notificationId, models);
|
const modifiedUser = await getUserToModify(notificationId, null, models);
|
||||||
|
|
||||||
if (user == modifiedUser.id || modifiedUser.bossFk == user) {
|
if (user == modifiedUser.id || modifiedUser.bossFk == user) {
|
||||||
await models.NotificationSubscription.destroyById(notificationId);
|
await models.NotificationSubscription.destroyById(notificationId);
|
||||||
|
|
Loading…
Reference in New Issue