Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web) display wrong apikey-name on edit #7131

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions web/src/lib/components/forms/api-key-form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
export let title = 'API Key';
export let cancelText = 'Cancel';
export let submitText = 'Save';
export let apiKeyName = 'API Key';

const dispatch = createEventDispatcher<{
cancel: void;
submit: Partial<ApiKeyResponseDto>;
}>();
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",
Expand All @@ -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">
Expand Down
Loading