Merge pull request 'api/tasks: prefix impure actions with run' (#4239) from api-cleanup into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4239
This commit is contained in:
hsjobeki
2025-07-07 11:28:07 +00:00
20 changed files with 69 additions and 56 deletions

View File

@@ -75,7 +75,7 @@ export const MachineListItem = (props: MachineListItemProps) => {
}
setInstalling(true);
await callApi("install_machine", {
await callApi("run_machine_install", {
opts: {
machine: {
name: name,
@@ -163,7 +163,7 @@ export const MachineListItem = (props: MachineListItemProps) => {
}
await callApi(
"deploy_machine",
"run_machine_deploy",
{
machine: {
name: name,

View File

@@ -23,7 +23,7 @@ const EditClanForm = (props: EditClanFormProps) => {
const handleSubmit: SubmitHandler<GeneralData> = async (values, event) => {
await toast.promise(
(async () => {
await callApi("update_clan_meta", {
await callApi("set_clan_details", {
options: {
flake: { identifier: props.directory },
meta: values,

View File

@@ -157,7 +157,7 @@ export const Flash = () => {
console.log("Confirmed flash:", values);
try {
await toast.promise(
callApi("flash_machine", {
callApi("run_machine_flash", {
machine: {
name: values.machine.devicePath,
flake: {

View File

@@ -120,7 +120,7 @@ export function InstallMachine(props: InstallMachineProps) {
throw new Error("No target host found for the machine");
}
const installPromise = callApi("install_machine", {
const installPromise = callApi("run_machine_install", {
opts: {
machine: {
name: props.name,

View File

@@ -149,7 +149,7 @@ export function MachineForm(props: MachineFormProps) {
setIsUpdating(true);
const r = await callApi(
"deploy_machine",
"run_machine_deploy",
{
machine: {
name: machine,

View File

@@ -23,7 +23,7 @@ const EditClanForm = (props: EditClanFormProps) => {
const handleSubmit: SubmitHandler<GeneralData> = async (values, event) => {
await toast.promise(
(async () => {
await callApi("update_clan_meta", {
await callApi("set_clan_details", {
options: {
flake: { identifier: props.directory },
meta: values,