Repository: louislam/uptime-kuma
File: server/notification-providers/teams.js (JavaScript)

Code before:
                                        size: "Medium",
                                        weight: "Bolder",
                                        text: `**${this._statusMessageFactory(status, monitorName, false)}**`,
                                    },
                                    {
                                        type: "TextBlock",
                                        size: "Small",
                                        weight: "Default",
                                        text: "Uptime Kuma Alert",
                                        isSubtle: true,
                                        spacing: "None",
                                    },
                                ],
                            },
                        ],
                    },
                ],
            },
            {
                type: "FactSet",
                separator: false,
                facts: facts,
            },
        ];

        if (enableTags && monitorJSON?.tags && monitorJSON.tags.length > 0) {
            payloadBody.push({
                type: "Container",
                layouts: [
                    {
                        type: "Layout.Flow",
                        columnSpacing: "Small",
                        rowSpacing: "Small",
                        horizontalItemsAlignment: "Left",
                    },
                ],
                items: monitorJSON.tags.map((tag) => {
                    return {
                        type: "Badge",
                        text: this._tagDisplayText(tag),
                        size: "Medium",
                        style: "Accent",
                    };
                }),
            });
        }

        const payload = {
            type: "message",
            // message with status prefix as notification text
            summary: this._statusMessageFactory(status, monitorName, true),

Review comment (suggestion):
```suggestion
        if (enableTags && monitorJSON?.tags?.length > 0) {
```


Code after:
                                        size: "Medium",
                                        weight: "Bolder",
                                        text: `**${this._statusMessageFactory(status, monitorName, false)}**`,
                                    },
                                    {
                                        type: "TextBlock",
                                        size: "Small",
                                        weight: "Default",
                                        text: "Uptime Kuma Alert",
                                        isSubtle: true,
                                        spacing: "None",
                                    },
                                ],
                            },
                        ],
                    },
                ],
            },
            {
                type: "FactSet",
                separator: false,
                facts: facts,
            },
        ];

        if (enableTags && monitorJSON?.tags?.length > 0) {
            payloadBody.push({
                type: "Container",
                layouts: [
                    {
                        type: "Layout.Flow",
                        columnSpacing: "Small",
                        rowSpacing: "Small",
                        horizontalItemsAlignment: "Left",
                    },
                ],
                items: monitorJSON.tags.map((tag) => {
                    return {
                        type: "Badge",
                        text: this._tagDisplayText(tag),
                        size: "Medium",
                        style: "Accent",
                    };
                }),
            });
        }

        const payload = {
            type: "message",
            // message with status prefix as notification text
            summary: this._statusMessageFactory(status, monitorName, true),