public async Task <IActionResult> PinNote(int noteId) { var userId = TokenUserId(); if (await note.PinNote(noteId, userId)) { string status = "Pin successful"; return(Ok(new { status, userId, noteId })); } else { string status = "Pin is not successful"; return(BadRequest(new { status, userId, noteId })); } }