const user = await this.getUser(userId); user.assert(UserTypes.Permission.WriteArticle); const post = await this.postRepository.getOrFail(id); const html = post.content.body ? this.htmlUnboxing(post.content.body, isMobile) : ''; const materialId = isMobile ? `M${id}` : id; const callbackUrl = `${VERSTKA_CALLBACK_URL}/${id}`; const callbackSign = createHash('md5') .update(`${VERSTKA_SECRET}${VERSTKA_API_KEY}${materialId}${userId}${callbackUrl}`) .digest('hex'); const customFields = { mobile: isMobile, 'fonts.css': VERSTKA_FONTS, };
def add(a, b) return a + b end