Disable users on items for now
This commit is contained in:
parent
7712f63999
commit
5353941140
@ -24,8 +24,8 @@ public record GetTodoByIdQuery([Required] string TodoId) : IRequest<TodoViewMode
|
|||||||
var userId = _currentUserService.GetUserId();
|
var userId = _currentUserService.GetUserId();
|
||||||
var todo = await _todoRepository.GetTodoByIdAsync(request.TodoId);
|
var todo = await _todoRepository.GetTodoByIdAsync(request.TodoId);
|
||||||
|
|
||||||
if (todo.AuthorId != userId)
|
//if (todo.AuthorId != userId)
|
||||||
throw new InvalidOperationException("User is not allowed to access todo");
|
// throw new InvalidOperationException("User is not allowed to access todo");
|
||||||
|
|
||||||
return TodoViewModel.From(todo);
|
return TodoViewModel.From(todo);
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,9 @@ export const TodoItem: FC<TodoItemProps> = (props) => {
|
|||||||
{props.todo.description && (
|
{props.todo.description && (
|
||||||
<div className="h-3 w-3 bg-gray-100 dark:border-black border border-gray-300 dark:bg-gray-900 rounded-sm" />
|
<div className="h-3 w-3 bg-gray-100 dark:border-black border border-gray-300 dark:bg-gray-900 rounded-sm" />
|
||||||
)}
|
)}
|
||||||
|
{!props.todo.authorId && (
|
||||||
|
<div className="h-3 w-3 bg-red-500 rounded-sm" />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{props.displayProject && props.todo.project && (
|
{props.displayProject && props.todo.project && (
|
||||||
<div className="text-gray-500 text-xs text-right whitespace-nowrap place-self-end">
|
<div className="text-gray-500 text-xs text-right whitespace-nowrap place-self-end">
|
||||||
|
@ -12,6 +12,7 @@ export interface Todo {
|
|||||||
description?: string;
|
description?: string;
|
||||||
status: StatusState;
|
status: StatusState;
|
||||||
project?: string;
|
project?: string;
|
||||||
|
authorId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const asTodo = (item: Todo): Todo => {
|
export const asTodo = (item: Todo): Todo => {
|
||||||
|
Loading…
Reference in New Issue
Block a user