Example #1
0
        public async Task <IActionResult> DeleteAsync(string userId, int jobId)
        {
            // aquí podríamos considerar que si no existe el elemento a borrar entonces todo Ok
            var jobEntity = await _favoriteRepository.GetFavoriteByIdAsync(userId, jobId);

            if (jobEntity == null)
            {
                return(NotFound());
            }

            _favoriteRepository.DeleteFavoriteByIdAsync(userId, jobId);

            return(NoContent());
        }