diff --git a/src/server/types/MutationsForSupport.js b/src/server/types/MutationsForSupport.js index 5f665f4..85cebf3 100644 --- a/src/server/types/MutationsForSupport.js +++ b/src/server/types/MutationsForSupport.js @@ -380,12 +380,17 @@ const resolvers = { const oldPetState = await petStateLoader.load(appearanceId); - const { moodId, female, unconverted } = getPetStateFieldsFromPose(pose); + const { + moodId, + female, + unconverted, + labeled, + } = getPetStateFieldsFromPose(pose); const [result] = await db.execute( - `UPDATE pet_states SET mood_id = ?, female = ?, unconverted = ? - WHERE id = ? LIMIT 1`, - [moodId, female, unconverted, appearanceId] + `UPDATE pet_states SET mood_id = ?, female = ?, unconverted = ?, + labeled = ? WHERE id = ? LIMIT 1`, + [moodId, female, unconverted, labeled, appearanceId] ); if (result.affectedRows !== 1) { diff --git a/src/server/util.js b/src/server/util.js index 8a456d5..b8fd18a 100644 --- a/src/server/util.js +++ b/src/server/util.js @@ -36,21 +36,21 @@ function getPoseFromPetState(petState) { function getPetStateFieldsFromPose(pose) { if (pose === "UNCONVERTED") { - return { moodId: null, female: null, unconverted: true }; + return { moodId: null, female: null, unconverted: true, labeled: true }; } else if (pose === "UNKNOWN") { - return { moodId: null, female: null, unconverted: false }; + return { moodId: null, female: null, unconverted: false, labeled: false }; } else if (pose === "HAPPY_MASC") { - return { moodId: "1", female: false, unconverted: false }; + return { moodId: "1", female: false, unconverted: false, labeled: true }; } else if (pose === "HAPPY_FEM") { - return { moodId: "1", female: true, unconverted: false }; + return { moodId: "1", female: true, unconverted: false, labeled: true }; } else if (pose === "SAD_MASC") { - return { moodId: "2", female: false, unconverted: false }; + return { moodId: "2", female: false, unconverted: false, labeled: true }; } else if (pose === "SAD_FEM") { - return { moodId: "2", female: true, unconverted: false }; + return { moodId: "2", female: true, unconverted: false, labeled: true }; } else if (pose === "SICK_MASC") { - return { moodId: "4", female: false, unconverted: false }; + return { moodId: "4", female: false, unconverted: false, labeled: true }; } else if (pose === "SICK_FEM") { - return { moodId: "4", female: true, unconverted: false }; + return { moodId: "4", female: true, unconverted: false, labeled: true }; } else { throw new Error(`unexpected pose ${pose}`); }