support new camelCase naming

This commit is contained in:
muhammadeko 2022-05-31 17:57:19 +07:00
parent a5bfdcc266
commit 13da38c55a
No known key found for this signature in database
GPG Key ID: 51366716C10E98B1
2 changed files with 16 additions and 16 deletions

View File

@ -80,12 +80,12 @@ export default function Artifacts() {
const handleMainStatChange = (event: any, value: any) => {
if (value !== null) {
setSelectedMainStat(value.Id);
setSelectedMainStat(value.id);
}
};
const getAffixIdByPropTypeAndPropValue = (propType: string, propValue: number) => {
return reliquaryAffixes.filter((x) => x.PropType === propType && x.PropValue === propValue)[0].Id;
return reliquaryAffixes.filter((x) => x.propType === propType && x.propValue === propValue)[0].id;
};
const getListOfIdsByPropTypeAndRequestValue = (affixName: string, requestValue: number) => {
@ -146,10 +146,10 @@ export default function Artifacts() {
const getPropTypeValues = (affixes: IReliquaryAffix[]) => {
let propTypeValues: IPropTypeValues = {};
affixes.forEach(affix => {
if (propTypeValues[affix.PropType] === undefined) {
propTypeValues[affix.PropType] = [];
if (propTypeValues[affix.propType] === undefined) {
propTypeValues[affix.propType] = [];
}
if (affix.PropValue > 0) propTypeValues[affix.PropType].push(affix.PropValue);
if (affix.propValue > 0) propTypeValues[affix.propType].push(affix.propValue);
});
return propTypeValues;
};
@ -237,7 +237,7 @@ export default function Artifacts() {
aria-label="Artifact Main Stats" id="ArtifactMainStats"
className="block w-full shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm border-gray-300 rounded-md"
options={reliquaryMains}
getOptionLabel={(option) => t(option.PropType)}
getOptionLabel={(option) => t(option.propType)}
onChange={handleMainStatChange}
renderInput={(params) => <TextField {...params} label="Main Stats"
variant="outlined"/>}

View File

@ -1,15 +1,15 @@
export interface IReliquaryMain {
Id: number;
PropDepotId: number;
PropType:string;
AffixName:string;
id: number;
propDepotId: number;
propType:string;
affixName:string;
}
export interface IReliquaryAffix {
Id: number;
DepotId: number;
GroupId: number;
PropType:string;
PropValue:number;
id: number;
depotId: number;
groupId: number;
propType:string;
propValue:number;
}
export default class ReliquaryDataProvider {
private static reliquaryMains:IReliquaryMain[] = [];
@ -25,7 +25,7 @@ export default class ReliquaryDataProvider {
let json:IReliquaryMain[] = await data.json();
this.reliquaryMains = [];
json.forEach(element => {
if (this.reliquaryMains.filter(x => x.PropType === element.PropType).length === 0)
if (this.reliquaryMains.filter(x => x.propType === element.propType).length === 0)
this.reliquaryMains.push(element)
});
}