MCPcopy Index your code
hub / github.com/coder/coder / setChatUserRole

Function setChatUserRole

site/src/api/queries/chats.ts:2052–2063  ·  view source on GitHub ↗
(queryClient: QueryClient)

Source from the content-addressed store, hash-verified

2050};
2051
2052export const setChatUserRole = (queryClient: QueryClient) => ({
2053 mutationFn: ({ chatId, userId, role }: SetChatUserRoleVariables) =>
2054 API.experimental.updateChatACL(chatId, {
2055 user_roles: { [userId]: role },
2056 }),
2057 onSuccess: async (_data: unknown, { chatId }: SetChatUserRoleVariables) => {
2058 await queryClient.invalidateQueries({
2059 queryKey: chatACLKey(chatId),
2060 exact: true,
2061 });
2062 },
2063});
2064
2065export const setChatGroupRole = (queryClient: QueryClient) => ({
2066 mutationFn: ({ chatId, groupId, role }: SetChatGroupRoleVariables) =>

Callers 2

chats.test.tsFile · 0.90

Calls 1

chatACLKeyFunction · 0.85

Tested by

no test coverage detected