Skip to content

Commit 79a4436

Browse files
Merge pull request Human-Connection#54 in HC/hc-api-feathers from develop to master
* commit 'ac5572e1e77e9f29cfbcc944e6b87bf1b222bd79': fixed avatar placeholder fixed thumbnails for user
2 parents 76ea0a4 + ac5572e commit 79a4436

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

server/services/users/users.hooks.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ 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+
placeholder: '36x36/smart/filters:blur(30)'
60+
},
61+
coverImg: {
62+
cover: '1102x312/smart',
63+
coverPlaceholder: '243x100/smart/filters:blur(30)'
64+
}
65+
};
66+
5467
module.exports = {
5568
before: {
5669
all: [],
@@ -116,27 +129,11 @@ module.exports = {
116129
cleanupBasicData
117130
],
118131
find: [
119-
thumbnails({
120-
avatar: {
121-
small: '72x72/smart',
122-
medium: '120x120/smart',
123-
large: '240x240/smart'
124-
}
125-
}),
132+
thumbnails(thumbnailOptions),
126133
cleanupPersonalData
127134
],
128135
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-
}),
136+
thumbnails(thumbnailOptions),
140137
cleanupPersonalData
141138
],
142139
create: [
@@ -146,9 +143,12 @@ module.exports = {
146143
when(isProvider('external'),
147144
removeVerification()
148145
),
146+
thumbnails(thumbnailOptions),
149147
inviteCode.after
150148
],
151-
update: [],
149+
update: [
150+
thumbnails(thumbnailOptions)
151+
],
152152
patch: [],
153153
remove: []
154154
},

0 commit comments

Comments
 (0)