Skip to content

Commit

Permalink
Remove thread unused routes (#4878)
Browse files Browse the repository at this point in the history
* remove unused routes

* fix thread integration tests WIP

* add tests to update thread

* bump lint mem

* update server test

* restore rollbar

* fix server test

* remove outdated topic test
  • Loading branch information
rbennettcw authored Aug 30, 2023
1 parent 42a1405 commit e3c82cf
Show file tree
Hide file tree
Showing 21 changed files with 205 additions and 1,651 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ import {
GetBulkThreadsResult,
__getBulkThreads,
} from './server_threads_methods/get_bulk_threads';
import {
ArchiveOrUnarchiveThreadOptions,
ArchiveOrUnarchiveThreadResult,
__archiveOrUnarchiveThread,
} from './server_threads_methods/archive_or_unarchive_thread';

/**
* Implements methods related to threads
Expand Down Expand Up @@ -121,10 +116,4 @@ export class ServerThreadsController {
): Promise<GetBulkThreadsResult> {
return __getBulkThreads.call(this, options);
}

async archiveOrUnarchiveThread(
options: ArchiveOrUnarchiveThreadOptions
): Promise<ArchiveOrUnarchiveThreadResult> {
return __archiveOrUnarchiveThread.call(this, options);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,12 @@ async function setThreadStage(
// fetch available stages
let customStages = [];
try {
customStages = Array.from(JSON.parse(chain.custom_stages))
.map((s) => s.toString())
.filter((s) => s);
const chainStages = JSON.parse(chain.custom_stages);
if (Array.isArray(chainStages)) {
customStages = Array.from(chainStages)
.map((s) => s.toString())
.filter((s) => s);
}
if (customStages.length === 0) {
customStages = [
'discussion',
Expand Down Expand Up @@ -658,8 +661,6 @@ async function updateThreadCollaborators(
}
}

const toUpdate: Partial<ThreadAttributes> = {};

// add collaborators
if (toAddUnique.length > 0) {
const collaboratorAddresses = await models.Address.findAll({
Expand Down Expand Up @@ -698,9 +699,5 @@ async function updateThreadCollaborators(
transaction,
});
}

if (Object.keys(toUpdate).length > 0) {
await thread.update(toUpdate, { transaction });
}
}
}
169 changes: 0 additions & 169 deletions packages/commonwealth/server/routes/addEditors.ts

This file was deleted.

88 changes: 0 additions & 88 deletions packages/commonwealth/server/routes/deleteEditors.ts

This file was deleted.

Loading

0 comments on commit e3c82cf

Please sign in to comment.