Skip to content

Commit

Permalink
fix: changes suggested by Majk
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebubeker committed Oct 31, 2023
1 parent da439df commit 0e3623f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions apps/web/components/map/panels/filter/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ const FilterPanel = (props: FilterPanelProps) => {
const { data: updatedData, mutate } = getFilterQueryExpressions(
layerToBeFiltered,
);

console.log(updatedData)

const [logicalOperator, setLogicalOperatorVal] = useState<string>(
"match_all_expressions",
Expand Down
6 changes: 3 additions & 3 deletions apps/web/components/map/panels/layer/Layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ const LayerPanel = ({
const { t } = useTranslation("maps");

const [resultProjectLayers, setResultProjectLayers] = useState<
Layer[] | null
>(null);
Layer[]
>([]);

function filterConditionals(layer: Layer) {
if (["none", "All"].includes(activeFilter)) {
Expand Down Expand Up @@ -100,7 +100,7 @@ const LayerPanel = ({
useEffect(() => {
getProjectLayers(projectId).then((data) => {
console.log(data)
const layers = data.map((layer) => ({ ...layer, active: false }));
const layers = data.map((layer: Layer) => ({ ...layer, active: false }));
setResultProjectLayers(layers);
dispatch(setLayers(layers));
});
Expand Down
4 changes: 2 additions & 2 deletions apps/web/lib/api/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import useSWR from "swr";
import { fetchWithAuth, fetcher } from "@/lib/api/fetcher";
import type {
ProjectPaginated,
ProjectLayers,
Project,
PostProject,
} from "@/lib/validations/project";
import type { GetContentQueryParams } from "@/lib/validations/common";
import type { Layer } from "@/lib/validations/layer";

export const PROJECTS_API_BASE_URL = new URL(
"api/v2/project",
Expand Down Expand Up @@ -63,7 +63,7 @@ export const createProject = async (

export const getProjectLayers = async (id: string) => {
try {
const data: Promise<ProjectLayers[]> = (
const data: Promise<Layer[]> = (
await fetchWithAuth(`${PROJECTS_API_BASE_URL}/${id}/layer`)
).json();
return data;
Expand Down
1 change: 1 addition & 0 deletions apps/web/lib/validations/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const layerMetadataSchema = contentMetadataSchema.extend({

export const layerSchema = layerMetadataSchema.extend({
active: z.boolean().optional(),
name: z.string().optional(),
updated_at: z.string(),
created_at: z.string(),
extent: z.string(),
Expand Down

0 comments on commit 0e3623f

Please sign in to comment.