Commit 198f25df authored by NataliaTepluhina's avatar NataliaTepluhina Committed by Natalia Tepluhina

Added a check for user: null

Changelog: changed
parent 7945d196
......@@ -113,7 +113,9 @@ export default {
update(data) {
// TODO Remove null filter (BE fix required)
// https://gitlab.com/gitlab-org/gitlab/-/issues/329750
return data.workspace?.users?.nodes.filter((x) => x).map(({ user }) => user) || [];
const users = data.workspace?.users?.nodes.filter((x) => x).map(({ user }) => user) || [];
// User field is nullable and we only want to display non-null users
return users.filter((u) => u);
},
debounce: ASSIGNEES_DEBOUNCE_DELAY,
error({ graphQLErrors }) {
......
......@@ -535,14 +535,15 @@ export default {
})
.then(({ data }) => {
const [firstError] = data.workspace.errors || [];
const assignees = data.workspace.assignees.nodes;
const assignees = data.workspace.assignees.nodes.map(({ user }) => user);
if (firstError) {
throw new Error(firstError);
}
commit(
types.RECEIVE_ASSIGNEES_SUCCESS,
assignees.map(({ user }) => user),
// User field is nullable and we only want to display non-null users
assignees.filter((u) => u),
);
})
.catch((e) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment