design & shits

This commit is contained in:
2024-04-12 20:13:59 +03:00
parent d6cfedfe06
commit 2a781e9603
10 changed files with 188 additions and 41 deletions

View File

@ -2,6 +2,11 @@ import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
import { baseUrl } from "../config/baseUrl";
import { RootState } from "../config/store";
export type CreateQueueRequest = {
name: string;
description: string | null;
};
export const QueueApi = createApi({
reducerPath: "QueueApi",
baseQuery: fetchBaseQuery({
@ -18,7 +23,14 @@ export const QueueApi = createApi({
getQueues: builder.query({
query: () => "/",
}),
createQueue: builder.mutation({
query: (data: CreateQueueRequest) => ({
url: "/",
method: "POST",
body: data,
}),
}),
}),
});
export const { useGetQueuesQuery } = QueueApi;
export const { useGetQueuesQuery, useCreateQueueMutation } = QueueApi;