mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: message.
This commit is contained in:
1 parent
d02af857f4
commit
b5c381f85d
1 file changed
+16
-5
@@ -9,8 +9,21 @@
|
||||
|
||||
export let show = false;
|
||||
export let selectedDomain: Models.ProxyRule;
|
||||
|
||||
let error = '';
|
||||
|
||||
function getCorrectMessage(): string {
|
||||
const resourceType = selectedDomain.resourceType;
|
||||
switch (resourceType) {
|
||||
case 'api':
|
||||
return `access ${resourceType}`;
|
||||
case 'function':
|
||||
return `execute your ${resourceType}`;
|
||||
case 'site':
|
||||
return `view your ${resourceType} `;
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteDomain() {
|
||||
try {
|
||||
await sdk.forProject.proxy.deleteRule(selectedDomain.$id);
|
||||
@@ -28,9 +41,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Confirm title="Delete domain" bind:open={show} onSubmit={deleteDomain} bind:error>
|
||||
{#if selectedDomain}
|
||||
<p data-private>Are you sure you want to delete <b>{selectedDomain.domain}</b>?</p>
|
||||
<p>You will no longer be able to execute your function by visiting this domain.</p>
|
||||
{/if}
|
||||
<Confirm onSubmit={deleteDomain} title="Delete domain" bind:open={show} bind:error>
|
||||
<p data-private>Are you sure you want to delete <b>{selectedDomain?.domain}</b>?</p>
|
||||
<p>You will no longer be able to {getCorrectMessage()} by visiting this domain.</p>
|
||||
</Confirm>
|
||||
Reference in new issue
Block a user