Skip to content

Commit

Permalink
Merge pull request #20 from Chia-Network/develop
Browse files Browse the repository at this point in the history
Release: 1.6.11
  • Loading branch information
MichaelTaylor3D authored Sep 7, 2023
2 parents 3b2bd0c + 6fe3991 commit 37099d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-registry-cadt",
"version": "1.6.10",
"version": "1.6.11",
"_comment": "DONT CHANGE MAJOR UNLESS DATAMODEL CHANGES: The major version corresponds to the datamodel version your using, so 2.0.0 means it'll use datamodel v2",
"private": true,
"bin": "build/server.js",
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/organization.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const editHomeOrg = async (req, res) => {
await assertWalletIsSynced();
await assertHomeOrgExists();

const { name } = req.body;
const { name, prefix } = req.body;

let icon;

Expand All @@ -34,7 +34,7 @@ export const editHomeOrg = async (req, res) => {
icon = '';
}

Organization.editOrgMeta({ name, icon });
Organization.editOrgMeta({ name, icon, prefix });

return res.json({
message: 'Home org currently being updated, will be completed soon.',
Expand Down
2 changes: 1 addition & 1 deletion src/database/migrations/20230824175347-add-prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
queryInterface.addColumn(table, 'prefix', {
type: Sequelize.STRING,
allowNull: true,
defaultValue: '{}',
defaultValue: '0',
});
}),
);
Expand Down
7 changes: 6 additions & 1 deletion src/models/organizations/organizations.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Organization extends Model {
'fileStoreId',
'registryHash',
'metadata',
'prefix',
],
where: { isHome: true },
raw: true,
Expand Down Expand Up @@ -427,7 +428,7 @@ class Organization extends Model {
}
};

static editOrgMeta = async ({ name, icon }) => {
static editOrgMeta = async ({ name, icon, prefix }) => {
const myOrganization = await Organization.getHomeOrg();

const payload = {};
Expand All @@ -440,6 +441,10 @@ class Organization extends Model {
payload.icon = icon;
}

if (prefix) {
payload.prefix = prefix;
}

await datalayer.upsertDataLayer(myOrganization.orgUid, payload);
};

Expand Down

0 comments on commit 37099d0

Please sign in to comment.