hotfix(medusa-plugin-slack-notification): proper thumbnails in blocks
This commit is contained in:
1 parent
6b5ebce34c
commit
f009099c79
1 file changed
+8
-5
@@ -95,17 +95,20 @@ class SlackService extends BaseService {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
if (lineItem.thumbnail) {
|
if (lineItem.thumbnail) {
|
||||||
line.accessory.type = "image"
|
let url = lineItem.thumbnail
|
||||||
if (
|
if (
|
||||||
!lineItem.thumbnail.startsWith("http:") &&
|
!lineItem.thumbnail.startsWith("http:") &&
|
||||||
!lineItem.thumbnail.startsWith("https:")
|
!lineItem.thumbnail.startsWith("https:")
|
||||||
) {
|
) {
|
||||||
line.accessory.image_url = `https:${lineItem.thumbnail}`
|
url = `https:${lineItem.thumbnail}`
|
||||||
} else {
|
}
|
||||||
line.accessory.image_url = lineItem.thumbnail
|
|
||||||
|
line.accessory = {
|
||||||
|
type: "image",
|
||||||
|
alt_text: "Item",
|
||||||
|
image_url: url
|
||||||
}
|
}
|
||||||
|
|
||||||
line.accessory.alt_text = "Item"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blocks.push(line)
|
blocks.push(line)
|
||||||
|
|||||||
Reference in new issue
Block a user