mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Fix lint errors
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Query, type Models } from '@appwrite.io/console';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { getLimit, getPage, getQuery, getSearch, pageToOffset } from '$lib/helpers/load';
|
||||
import { queries, queryParamToMap } from '$lib/components/filters';
|
||||
import { Dependencies, PAGE_LIMIT } from '$lib/constants';
|
||||
import { getLimit, getPage, getQuery, getSearch, pageToOffset } from '$lib/helpers/load';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { Query, type Models } from '@appwrite.io/console';
|
||||
import type { PageLoad } from './$types';
|
||||
import { queryParamToMap, queries } from '$lib/components/filters';
|
||||
|
||||
export const load: PageLoad = async ({ params, url, route, depends }) => {
|
||||
depends(Dependencies.USER_TARGETS);
|
||||
@@ -42,7 +42,7 @@ export const load: PageLoad = async ({ params, url, route, depends }) => {
|
||||
payload
|
||||
);
|
||||
|
||||
const promisesById: Record<string, Promise<any>> = {};
|
||||
const promisesById: Record<string, Promise<Models.Provider>> = {};
|
||||
targets.targets.forEach((target) => {
|
||||
if (target.providerId && !promisesById[target.providerId]) {
|
||||
promisesById[target.providerId] = sdk.forProject.client.call(
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
import { Button, FormList, InputText, InputTextarea } from '$lib/elements/forms';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let message: Models.Message & { data: Record<string, string>; };
|
||||
export let message: Models.Message & { data: Record<string, string> };
|
||||
export let onEdit: () => void = null;
|
||||
</script>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import PushPhone from '../pushPhone.svelte';
|
||||
|
||||
export let message: Models.Message & { data: Record<string, string>; };
|
||||
export let message: Models.Message & { data: Record<string, string> };
|
||||
export let onEdit: () => void = null;
|
||||
</script>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import SMSPhone from '../smsPhone.svelte';
|
||||
|
||||
export let message: Models.Message & { data: Record<string, string>; };
|
||||
export let message: Models.Message & { data: Record<string, string> };
|
||||
export let onEdit: () => void = null;
|
||||
</script>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import type { Models } from "@appwrite.io/console";
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
export let type: ProviderTypes | Models.Provider['type'];
|
||||
export let noIcon = false;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { writable } from 'svelte/store';
|
||||
import type { Column } from '$lib/helpers/types';
|
||||
import { writable } from 'svelte/store';
|
||||
import { Providers } from '../provider.svelte';
|
||||
import { ProviderTypes } from '../providerType.svelte';
|
||||
|
||||
export let showCreate = writable(false);
|
||||
|
||||
export const columns = writable<Column[]>([
|
||||
{ id: '$id', title: 'Provider ID', type: 'string', show: true },
|
||||
{ id: 'name', title: 'Name', type: 'string', show: true },
|
||||
|
||||
@@ -81,29 +81,33 @@
|
||||
);
|
||||
break;
|
||||
case ProviderTypes.Push:
|
||||
const customData: Record<string, string> = {};
|
||||
const { data } = $messageParams[ProviderTypes.Push];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item) => {
|
||||
if (item[0] === '') return;
|
||||
customData[item[0]] = item[1];
|
||||
});
|
||||
}
|
||||
|
||||
response = await sdk.forProject.client.call(
|
||||
'POST',
|
||||
new URL(sdk.forProject.client.config.endpoint + '/messaging/messages/push'),
|
||||
{
|
||||
'X-Appwrite-Project': sdk.forProject.client.config.project,
|
||||
'content-type': 'application/json',
|
||||
'X-Appwrite-Mode': 'admin'
|
||||
},
|
||||
{
|
||||
...payload,
|
||||
data: customData,
|
||||
messageId
|
||||
{
|
||||
const customData: Record<string, string> = {};
|
||||
const { data } = $messageParams[ProviderTypes.Push];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item) => {
|
||||
if (item[0] === '') return;
|
||||
customData[item[0]] = item[1];
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
response = await sdk.forProject.client.call(
|
||||
'POST',
|
||||
new URL(
|
||||
sdk.forProject.client.config.endpoint + '/messaging/messages/push'
|
||||
),
|
||||
{
|
||||
'X-Appwrite-Project': sdk.forProject.client.config.project,
|
||||
'content-type': 'application/json',
|
||||
'X-Appwrite-Mode': 'admin'
|
||||
},
|
||||
{
|
||||
...payload,
|
||||
data: customData,
|
||||
messageId
|
||||
}
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
wizard.hide();
|
||||
@@ -198,31 +202,33 @@
|
||||
);
|
||||
break;
|
||||
case ProviderTypes.Push:
|
||||
const customData: Record<string, string> = {};
|
||||
const { data } = $messageParams[ProviderTypes.Push];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item) => {
|
||||
if (item[0] === '') return;
|
||||
customData[item[0]] = item[1];
|
||||
});
|
||||
}
|
||||
|
||||
response = await sdk.forProject.client.call(
|
||||
'PATCH',
|
||||
new URL(
|
||||
`${sdk.forProject.client.config.endpoint}/messaging/messages/push/${messageId}`
|
||||
),
|
||||
{
|
||||
'X-Appwrite-Project': sdk.forProject.client.config.project,
|
||||
'content-type': 'application/json',
|
||||
'X-Appwrite-Mode': 'admin'
|
||||
},
|
||||
{
|
||||
...payload,
|
||||
data: customData,
|
||||
messageId
|
||||
{
|
||||
const customData: Record<string, string> = {};
|
||||
const { data } = $messageParams[ProviderTypes.Push];
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item) => {
|
||||
if (item[0] === '') return;
|
||||
customData[item[0]] = item[1];
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
response = await sdk.forProject.client.call(
|
||||
'PATCH',
|
||||
new URL(
|
||||
`${sdk.forProject.client.config.endpoint}/messaging/messages/push/${messageId}`
|
||||
),
|
||||
{
|
||||
'X-Appwrite-Project': sdk.forProject.client.config.project,
|
||||
'content-type': 'application/json',
|
||||
'X-Appwrite-Mode': 'admin'
|
||||
},
|
||||
{
|
||||
...payload,
|
||||
data: customData,
|
||||
messageId
|
||||
}
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
wizard.hide();
|
||||
|
||||
@@ -100,4 +100,3 @@
|
||||
<Button secondary submit>Delete</Button>
|
||||
</svelte:fragment>
|
||||
</Modal> -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user