mirror of
https://github.com/immich-app/immich.git
synced 2024-12-29 15:11:58 +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 cancelText = 'Cancel';
|
||||
export let submitText = 'Save';
|
||||
export let apiKeyName = 'API Key';
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
cancel: void;
|
||||
|
@ -19,8 +18,8 @@
|
|||
}>();
|
||||
const handleCancel = () => dispatch('cancel');
|
||||
const handleSubmit = () => {
|
||||
if (apiKeyName) {
|
||||
dispatch('submit', { ...apiKey, name: apiKeyName });
|
||||
if (apiKey.name) {
|
||||
dispatch('submit', apiKey);
|
||||
} else {
|
||||
notificationController.show({
|
||||
message: "Your API Key name shouldn't be empty",
|
||||
|
@ -46,7 +45,7 @@
|
|||
<form on:submit|preventDefault={handleSubmit} autocomplete="off">
|
||||
<div class="m-4 flex flex-col gap-2">
|
||||
<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 class="mt-8 flex w-full gap-4 px-4">
|
||||
|
|
Loading…
Reference in a new issue