Skip to content

Commit 512024a

Browse files
fixed thumbnails for user
1 parent 371c91a commit 512024a

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

server/services/users/users.hooks.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ const candosSchema = {
5151
const saveRemoteImages = require('../../hooks/save-remote-images');
5252
const createDefaultAvatar = require('../../hooks/create-default-avatar');
5353

54+
const thumbnailOptions = {
55+
avatar: {
56+
small: '72x72/smart',
57+
medium: '120x120/smart',
58+
large: '240x240/smart'
59+
},
60+
coverImg: {
61+
cover: '1102x312/smart',
62+
coverPlaceholder: '243x100/smart/filters:blur(30)'
63+
}
64+
};
65+
5466
module.exports = {
5567
before: {
5668
all: [],
@@ -116,27 +128,11 @@ module.exports = {
116128
cleanupBasicData
117129
],
118130
find: [
119-
thumbnails({
120-
avatar: {
121-
small: '72x72/smart',
122-
medium: '120x120/smart',
123-
large: '240x240/smart'
124-
}
125-
}),
131+
thumbnails(thumbnailOptions),
126132
cleanupPersonalData
127133
],
128134
get: [
129-
thumbnails({
130-
avatar: {
131-
small: '72x72/smart',
132-
medium: '120x120/smart',
133-
large: '240x240/smart'
134-
},
135-
coverImg: {
136-
cover: '1102x312/smart',
137-
coverPlaceholder: '243x100/smart/filters:blur(30)'
138-
}
139-
}),
135+
thumbnails(thumbnailOptions),
140136
cleanupPersonalData
141137
],
142138
create: [
@@ -146,9 +142,12 @@ module.exports = {
146142
when(isProvider('external'),
147143
removeVerification()
148144
),
145+
thumbnails(thumbnailOptions),
149146
inviteCode.after
150147
],
151-
update: [],
148+
update: [
149+
thumbnails(thumbnailOptions)
150+
],
152151
patch: [],
153152
remove: []
154153
},

0 commit comments

Comments
 (0)