fix: Update compatible motor identifiers in power supplies data
- Changed compatible motor identifier from "42AIM30" to "42AIM" in power supplies JSON to ensure consistency and accuracy in motor compatibility listings.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect, useMemo } from 'react';
|
||||||
import partsData from '../../data/index.js';
|
import partsData from '../../data/index.js';
|
||||||
import { getPriceDisplayFromLinksAsync } from '../../utils/bomUtils';
|
import { getPriceDisplayFromLinksAsync } from '../../utils/bomUtils';
|
||||||
import { useCurrency } from '../../contexts/CurrencyContext';
|
import { useCurrency } from '../../contexts/CurrencyContext';
|
||||||
@@ -16,10 +16,12 @@ export default function PowerSupplyStep({ config, updateConfig }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Filter compatible power supplies
|
// Filter compatible power supplies
|
||||||
const compatiblePowerSupplies = partsData.powerSupplies.filter((psu) => {
|
const compatiblePowerSupplies = useMemo(() => {
|
||||||
|
return partsData.powerSupplies.filter((psu) => {
|
||||||
if (!selectedMotorId) return true;
|
if (!selectedMotorId) return true;
|
||||||
return psu.compatibleMotors.includes(selectedMotorId);
|
return psu.compatibleMotors.includes(selectedMotorId);
|
||||||
});
|
});
|
||||||
|
}, [selectedMotorId]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const updatePrices = async () => {
|
const updatePrices = async () => {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"image": "/images/power-supplies/24v-PSU.png",
|
"image": "/images/power-supplies/24v-PSU.png",
|
||||||
"compatibleMotors": [
|
"compatibleMotors": [
|
||||||
"57AIM30",
|
"57AIM30",
|
||||||
"42AIM30",
|
"42AIM",
|
||||||
"iHSV57"
|
"iHSV57"
|
||||||
],
|
],
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
"image": "/images/power-supplies/24v-usbc-pd.png",
|
"image": "/images/power-supplies/24v-usbc-pd.png",
|
||||||
"compatibleMotors": [
|
"compatibleMotors": [
|
||||||
"57AIM30",
|
"57AIM30",
|
||||||
"42AIM30",
|
"42AIM",
|
||||||
"iHSV57"
|
"iHSV57"
|
||||||
],
|
],
|
||||||
"required": true,
|
"required": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user