export const addGeoJsonItem = async (
token: string,
username: string,
url: string,
teamId: number,
countyName: string,
folderId: string | null = null
) => {
const geoJsonUrl = `${url}${teamId}`;
const addItemParams = new URLSearchParams({
f: 'json',
token,
type: 'GeoJson',
url: geoJsonUrl,
title: `${countyName}_all_points`,
});
if (folderId) {
addItemParams.append('folder', folderId);
}
const response = await axios.post(addItemUrl, addItemParams, {
});
if (response.data.error) {
throw new Error(response.data.error.message);
}
return response.data;
};
However, I get an issue saying Error: You do not have permissions to access this resource or perform this operation. I know that the token is valid from testing other endpoints as well as all of the other variables so this must be kind of permissions issue with my account settings, but I can't find anything that might be the culprit. My account is an administrator and I haven't touched the settings at all so I'm not sure what the problem could be.