Skip to content

Commit 8b3b6fd

Browse files
committed
Minor change on settings page
1 parent 27734a0 commit 8b3b6fd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/routes/settings/+page.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@
4545
cacheDirError = '';
4646
const headers = new Headers();
4747
headers.set('Content-Type', 'application/json');
48-
const payload = nullifyEmptyStrings({
49-
slurm_accounts: slurmAccounts,
50-
cache_dir: cacheDir
51-
});
48+
const payload = {
49+
slurm_accounts: slurmAccounts
50+
};
51+
if ($page.data.runnerBackend === 'slurm') {
52+
payload.cache_dir = cacheDir;
53+
}
5254
const response = await fetch(`/api/auth/current-user/settings`, {
5355
method: 'PATCH',
5456
credentials: 'include',
5557
headers,
56-
body: JSON.stringify(payload)
58+
body: JSON.stringify(nullifyEmptyStrings(payload))
5759
});
5860
const result = await response.json();
5961
if (response.ok) {

0 commit comments

Comments
 (0)