mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-25 19:01:14 +01:00
Generalized frontend model store (#193)
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import type { HttpResponse } from '@yaakapp-internal/models';
|
||||
import { getModel } from '@yaakapp-internal/models';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { getActiveCookieJar } from './useActiveCookieJar';
|
||||
import { getActiveEnvironment } from './useActiveEnvironment';
|
||||
import { useFastMutation } from './useFastMutation';
|
||||
import { getHttpRequest } from './useHttpRequests';
|
||||
|
||||
export function useSendAnyHttpRequest() {
|
||||
return useFastMutation<HttpResponse | null, string, string | null>({
|
||||
mutationKey: ['send_any_request'],
|
||||
mutationFn: async (id) => {
|
||||
const request = getHttpRequest(id ?? 'n/a');
|
||||
const request = getModel('http_request', id ?? 'n/a');
|
||||
if (request == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user