diff --git a/plugins/wazuh-check-updates/server/services/updates/get-updates.ts b/plugins/wazuh-check-updates/server/services/updates/get-updates.ts index fffb450839..c6fcdbcdf5 100644 --- a/plugins/wazuh-check-updates/server/services/updates/get-updates.ts +++ b/plugins/wazuh-check-updates/server/services/updates/get-updates.ts @@ -43,21 +43,28 @@ export const getUpdates = async (checkAvailableUpdates?: boolean): Promise { + if (update?.update_check === false) { + return API_UPDATES_STATUS.DISABLED; + } + + if ( + update?.last_available_patch?.tag || + update?.last_available_minor?.tag || + update?.last_available_patch?.tag + ) { + return API_UPDATES_STATUS.AVAILABLE_UPDATES; + } + + return API_UPDATES_STATUS.UP_TO_DATE; + }; const updateWithoutUUID = _.omit(update, 'uuid'); return { ...updateWithoutUUID, api_id: api.id, - status, + status: getStatus(), }; } catch (e: any) { const error = {