mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-27 02:58:34 +02:00
Run oxfmt across repo, add format script and docs
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import type { HttpRequest } from '@yaakapp-internal/models';
|
||||
import { patchModelById } from '@yaakapp-internal/models';
|
||||
import { createRequestAndNavigate } from '../lib/createRequestAndNavigate';
|
||||
import { jotaiStore } from '../lib/jotai';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { showToast } from '../lib/toast';
|
||||
import { activeWorkspaceIdAtom } from './useActiveWorkspace';
|
||||
import { useFastMutation } from './useFastMutation';
|
||||
import { wasUpdatedExternally } from './useRequestUpdateKey';
|
||||
import type { HttpRequest } from "@yaakapp-internal/models";
|
||||
import { patchModelById } from "@yaakapp-internal/models";
|
||||
import { createRequestAndNavigate } from "../lib/createRequestAndNavigate";
|
||||
import { jotaiStore } from "../lib/jotai";
|
||||
import { invokeCmd } from "../lib/tauri";
|
||||
import { showToast } from "../lib/toast";
|
||||
import { activeWorkspaceIdAtom } from "./useActiveWorkspace";
|
||||
import { useFastMutation } from "./useFastMutation";
|
||||
import { wasUpdatedExternally } from "./useRequestUpdateKey";
|
||||
|
||||
export function useImportCurl() {
|
||||
return useFastMutation({
|
||||
mutationKey: ['import_curl'],
|
||||
mutationKey: ["import_curl"],
|
||||
mutationFn: async ({
|
||||
overwriteRequestId,
|
||||
command,
|
||||
@@ -19,17 +19,17 @@ export function useImportCurl() {
|
||||
command: string;
|
||||
}) => {
|
||||
const workspaceId = jotaiStore.get(activeWorkspaceIdAtom);
|
||||
const importedRequest: HttpRequest = await invokeCmd('cmd_curl_to_request', {
|
||||
const importedRequest: HttpRequest = await invokeCmd("cmd_curl_to_request", {
|
||||
command,
|
||||
workspaceId,
|
||||
});
|
||||
|
||||
let verb: string;
|
||||
if (overwriteRequestId == null) {
|
||||
verb = 'Created';
|
||||
verb = "Created";
|
||||
await createRequestAndNavigate(importedRequest);
|
||||
} else {
|
||||
verb = 'Updated';
|
||||
verb = "Updated";
|
||||
await patchModelById(importedRequest.model, overwriteRequestId, (r: HttpRequest) => ({
|
||||
...importedRequest,
|
||||
id: r.id,
|
||||
@@ -44,7 +44,7 @@ export function useImportCurl() {
|
||||
}
|
||||
|
||||
showToast({
|
||||
color: 'success',
|
||||
color: "success",
|
||||
message: `${verb} request from Curl`,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user