mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
fix(web) display wrong apikey-name on edit (#7131)
* fix display wrong apikey-name on edit * use apiKey property with fallback value * remove null fallback * chore: cleanup --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
parent
c84c0bae6c
commit
67b1675850
1 changed files with 3 additions and 4 deletions
|
@ -11,7 +11,6 @@
|
||||||
export let title = 'API Key';
|
export let title = 'API Key';
|
||||||
export let cancelText = 'Cancel';
|
export let cancelText = 'Cancel';
|
||||||
export let submitText = 'Save';
|
export let submitText = 'Save';
|
||||||
export let apiKeyName = 'API Key';
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher<{
|
const dispatch = createEventDispatcher<{
|
||||||
cancel: void;
|
cancel: void;
|
||||||
|
@ -19,8 +18,8 @@
|
||||||
}>();
|
}>();
|
||||||
const handleCancel = () => dispatch('cancel');
|
const handleCancel = () => dispatch('cancel');
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (apiKeyName) {
|
if (apiKey.name) {
|
||||||
dispatch('submit', { ...apiKey, name: apiKeyName });
|
dispatch('submit', apiKey);
|
||||||
} else {
|
} else {
|
||||||
notificationController.show({
|
notificationController.show({
|
||||||
message: "Your API Key name shouldn't be empty",
|
message: "Your API Key name shouldn't be empty",
|
||||||
|
@ -46,7 +45,7 @@
|
||||||
<form on:submit|preventDefault={handleSubmit} autocomplete="off">
|
<form on:submit|preventDefault={handleSubmit} autocomplete="off">
|
||||||
<div class="m-4 flex flex-col gap-2">
|
<div class="m-4 flex flex-col gap-2">
|
||||||
<label class="immich-form-label" for="name">Name</label>
|
<label class="immich-form-label" for="name">Name</label>
|
||||||
<input class="immich-form-input" id="name" name="name" type="text" bind:value={apiKeyName} />
|
<input class="immich-form-input" id="name" name="name" type="text" bind:value={apiKey.name} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-8 flex w-full gap-4 px-4">
|
<div class="mt-8 flex w-full gap-4 px-4">
|
||||||
|
|
Loading…
Reference in a new issue