mirror of https://github.com/coder/coder.git
15 lines
426 B
TypeScript
15 lines
426 B
TypeScript
import * as API from "api/api";
|
|
import type { AuthorizationRequest } from "api/typesGenerated";
|
|
|
|
export const AUTHORIZATION_KEY = "authorization";
|
|
|
|
export const getAuthorizationKey = (req: AuthorizationRequest) =>
|
|
[AUTHORIZATION_KEY, req] as const;
|
|
|
|
export const checkAuthorization = (req: AuthorizationRequest) => {
|
|
return {
|
|
queryKey: getAuthorizationKey(req),
|
|
queryFn: () => API.checkAuthorization(req),
|
|
};
|
|
};
|