Files
portainer/app/react/docker/services/webhooks/getWebhooks.ts
T
2025-12-17 13:02:19 +02:00

25 lines
612 B
TypeScript

import axios, { parseAxiosError } from '@CE/portainer/services/axios';
import { EnvironmentId } from '@CE/react/portainer/environments/types';
import { buildUrl } from './build-url';
import { Webhook } from './types';
export async function getWebhooks(
environmentId: EnvironmentId,
serviceId: string
) {
try {
const { data } = await axios.get<Array<Webhook>>(buildUrl(), {
params: {
filters: JSON.stringify({
EndpointID: environmentId,
ResourceID: serviceId,
}),
},
});
return data;
} catch (error) {
throw parseAxiosError(error);
}
}