Updated external db sync to handle spool types and new color hex format

This commit is contained in:
Donkie
2024-05-20 22:39:08 +02:00
parent 5dcc28aa98
commit 52c52bcfd8
5 changed files with 105 additions and 10 deletions

View File

@@ -1,6 +1,27 @@
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
import { getAPIURL } from "./url";
export enum SpoolType {
PLASTIC = "plastic",
CARDBOARD = "cardboard",
METAL = "metal",
}
export enum Finish {
MATTE = "matte",
GLOSSY = "glossy",
}
export enum MultiColorDirection {
COAXIAL = "coaxial",
LONGITUDINAL = "longitudinal",
}
export enum Pattern {
MARBLE = "marble",
SPARKLE = "sparkle",
}
export interface ExternalFilament {
id: string;
manufacturer: string;
@@ -8,11 +29,18 @@ export interface ExternalFilament {
material: string;
density: number;
weight: number;
spool_weight: number | null;
spool_weight?: number;
spool_type?: SpoolType;
diameter: number;
color_hex: string;
extruder_temp: number | null;
bed_temp: number | null;
color_hex?: string;
color_hexes?: string[];
extruder_temp?: number;
bed_temp?: number;
finish?: Finish;
multi_color_direction?: MultiColorDirection;
pattern?: Pattern;
translucent: boolean;
glow: boolean;
}
export interface ExternalMaterial {