Added softkey data in the Favorite softkey API

This commit is contained in:
Lucio Maranta
2018-07-12 15:54:46 +02:00
parent e81e705f78
commit 9f5dadfc49
5 changed files with 136 additions and 97 deletions
@@ -1,5 +1,6 @@
using Step.Database.Controllers;
using Step.Model.DatabaseModels;
using Step.Model.DTOModels;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -22,7 +23,7 @@ namespace Step.Controllers.WebApi
// Find user id from the bearer token
var userId = identity.Claims.Where(c => c.Type == USER_ID_KEY).FirstOrDefault();
int userIdInt = Convert.ToInt32(userId.Value);
using (FavoriteUserSoftkeysController controller = new FavoriteUserSoftkeysController())
using (UserSoftkeysController controller = new UserSoftkeysController())
{
return Ok(
controller.GetUserFavoriteSoftkeys(userIdInt)
@@ -38,11 +39,11 @@ namespace Step.Controllers.WebApi
var userId = identity.Claims.Where(c => c.Type == USER_ID_KEY).FirstOrDefault();
int intUserId = Convert.ToInt32(userId.Value);
using (FavoriteUserSoftkeysController controller = new FavoriteUserSoftkeysController())
using (UserSoftkeysController controller = new UserSoftkeysController())
{
// Delete saved softkey
controller.DeleteUserSoftkeyModel(intUserId);
List<FavoriteUserSoftkeyModel> favorite = new List<FavoriteUserSoftkeyModel>();
List<DTOUserSoftKeyConfigModel> favorite = new List<DTOUserSoftKeyConfigModel>();
if (favoriteSoftkeyIds != null && favoriteSoftkeyIds.Count > 0)
{
// Insert new list of id