Spaces:
Running
Running
User
fix: adjust overall structure, clean out unnecessary fields, adjust table columns and layouts on task list and issue list
ecb51fa | using Microsoft.AspNetCore.Authorization; | |
| using Microsoft.AspNetCore.Mvc; | |
| using TaskTrackingSystem.Shared; | |
| using TaskTrackingSystem.Shared.Models.Notification; | |
| using TaskTrackingSystem.WebApi.Infrastructure; | |
| namespace TaskTrackingSystem.WebApi.Features.UserDevice; | |
| [] | |
| [] | |
| [] | |
| public class UserDevicesController : ControllerBase | |
| { | |
| private readonly UserDeviceService _userDeviceService; | |
| public UserDevicesController(UserDeviceService userDeviceService) | |
| { | |
| _userDeviceService = userDeviceService; | |
| } | |
| [] | |
| public async Task<ActionResult<Result>> Register([FromBody] RegisterDeviceTokenDto dto) | |
| { | |
| var userId = User.GetUserId(); | |
| if (userId <= 0) | |
| { | |
| return Unauthorized(Result.Failure("User is not authenticated.", 401)); | |
| } | |
| var result = await _userDeviceService.RegisterTokenAsync(userId, dto.FcmToken); | |
| return StatusCode(result.StatusCode, result); | |
| } | |
| } | |