* migration from organization to workspace on code level * updated a few more files * fixed runtime errors * update org settings URL * Renamed organizationId in domain objects * changed field named from organization to workspace * Reverted AppsmithRole changes * fixed migrations * recreating indexes * migration update * seed data runs before migration, undo changes * mock commit * seedmongo to populate upgraded data, datasource upgrade * fixed two test cases * updated migrations * updated prop name * Upgraded AclPermission * comment * migrated AppsmithRole * more changes * final set of changes * variable name changes * update cypress variable name * Update app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java * Update app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/Datasource.java Co-authored-by: Trisha Anand <trisha@appsmith.com> * reverting encryption handler change * migrated a few missed out org to workspace * migrated a few missed out org to workspace * migration changes * Removed Permission import * fixed AppsmithRole * mongodb version update * fixed compile error * fixed compile issue * fixed some tests * simplified embedded mongodb config * updated a cypress test Co-authored-by: Sidhant Goel <sidhant@appsmith.com> Co-authored-by: Trisha Anand <trisha@appsmith.com> Co-authored-by: Sidhant Goel <sidhant@hexcod.in>
52 lines
1.8 KiB
TypeScript
52 lines
1.8 KiB
TypeScript
import { rest } from "msw";
|
|
import {
|
|
addCommentToThreadMockResponse,
|
|
fetchApplicationThreadsMockResponse,
|
|
createNewThreadMockResponse,
|
|
} from "mockResponses/CommentApiMockResponse";
|
|
import CreateWorkspaceMockResponse from "mockResponses/CreateWorkspaceMockResponse.json";
|
|
import ApplicationsNewMockResponse from "mockResponses/ApplicationsNewMockResponse.json";
|
|
|
|
const mockSuccessRes = {
|
|
responseMeta: { status: 200, success: true },
|
|
data: {},
|
|
};
|
|
|
|
export const handlers = [
|
|
// mock apis here
|
|
rest.post("/api/v1/workspaces", (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(CreateWorkspaceMockResponse));
|
|
}),
|
|
rest.get("/api/v1/applications/new", (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(ApplicationsNewMockResponse));
|
|
}),
|
|
// comment thread api
|
|
// fetch application threads, accept query { applicationId }
|
|
rest.get("/api/v1/comments/threads", (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(fetchApplicationThreadsMockResponse));
|
|
}),
|
|
// create new thread
|
|
rest.post("/api/v1/comments/threads", (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(createNewThreadMockResponse));
|
|
}),
|
|
// add comment to thread
|
|
rest.post("/api/v1/comments", (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(addCommentToThreadMockResponse));
|
|
}),
|
|
rest.put(/.*/, (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(mockSuccessRes));
|
|
}),
|
|
rest.post(/.*/, (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(mockSuccessRes));
|
|
}),
|
|
rest.get(/.*/, (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(mockSuccessRes));
|
|
}),
|
|
rest.patch(/.*/, (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(mockSuccessRes));
|
|
}),
|
|
rest.delete(/.*/, (req, res, ctx) => {
|
|
return res(ctx.status(200), ctx.json(mockSuccessRes));
|
|
}),
|
|
];
|