Compare commits
2 Commits
bug/broken
...
fix/user-h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46ac7e3a16 | ||
|
|
d6c8400116 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-backend",
|
"name": "hoppscotch-backend",
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -360,13 +360,15 @@ describe('UserHistoryService', () => {
|
|||||||
});
|
});
|
||||||
describe('removeRequestFromHistory', () => {
|
describe('removeRequestFromHistory', () => {
|
||||||
test('Should resolve right and delete request from users history', async () => {
|
test('Should resolve right and delete request from users history', async () => {
|
||||||
|
const executedOn = new Date();
|
||||||
|
|
||||||
mockPrisma.userHistory.delete.mockResolvedValueOnce({
|
mockPrisma.userHistory.delete.mockResolvedValueOnce({
|
||||||
userUid: 'abc',
|
userUid: 'abc',
|
||||||
id: '1',
|
id: '1',
|
||||||
request: [{}],
|
request: [{}],
|
||||||
responseMetadata: [{}],
|
responseMetadata: [{}],
|
||||||
reqType: ReqType.REST,
|
reqType: ReqType.REST,
|
||||||
executedOn: new Date(),
|
executedOn: executedOn,
|
||||||
isStarred: false,
|
isStarred: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -376,7 +378,7 @@ describe('UserHistoryService', () => {
|
|||||||
request: JSON.stringify([{}]),
|
request: JSON.stringify([{}]),
|
||||||
responseMetadata: JSON.stringify([{}]),
|
responseMetadata: JSON.stringify([{}]),
|
||||||
reqType: ReqType.REST,
|
reqType: ReqType.REST,
|
||||||
executedOn: new Date(),
|
executedOn: executedOn,
|
||||||
isStarred: false,
|
isStarred: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -384,7 +386,7 @@ describe('UserHistoryService', () => {
|
|||||||
await userHistoryService.removeRequestFromHistory('abc', '1'),
|
await userHistoryService.removeRequestFromHistory('abc', '1'),
|
||||||
).toEqualRight(userHistory);
|
).toEqualRight(userHistory);
|
||||||
});
|
});
|
||||||
test('Should resolve left and error out when req id is invalid ', async () => {
|
test('Should resolve left and error out when req id is invalid', async () => {
|
||||||
mockPrisma.userHistory.delete.mockResolvedValueOnce(null);
|
mockPrisma.userHistory.delete.mockResolvedValueOnce(null);
|
||||||
|
|
||||||
return expect(
|
return expect(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/common",
|
"name": "@hoppscotch/common",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
|
|||||||
@@ -150,16 +150,12 @@ const workspace = useReadonlyStream(workspaceStatus$, { type: "personal" })
|
|||||||
// Used to switch environment type and team when user switch workspace in the global workspace switcher
|
// Used to switch environment type and team when user switch workspace in the global workspace switcher
|
||||||
// Check if there is a teamID in the workspace, if yes, switch to team environment and select the team
|
// Check if there is a teamID in the workspace, if yes, switch to team environment and select the team
|
||||||
// If there is no teamID, switch to my environment
|
// If there is no teamID, switch to my environment
|
||||||
watch(workspace, (newWorkspace, oldWorkspace) => {
|
watch(workspace, (newWorkspace) => {
|
||||||
// If we are switching into personal from outside
|
if (newWorkspace.type === "personal") {
|
||||||
if (newWorkspace.type === "personal" && oldWorkspace.type !== "personal") {
|
switchToMyEnvironments()
|
||||||
// If the selected environment is not a my environment, turn off the env
|
setSelectedEnvironmentIndex({
|
||||||
if (selectedEnvironmentIndex.value.type !== "MY_ENV") {
|
type: "NO_ENV_SELECTED",
|
||||||
switchToMyEnvironments()
|
})
|
||||||
setSelectedEnvironmentIndex({
|
|
||||||
type: "NO_ENV_SELECTED",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else if (newWorkspace.type === "team") {
|
} else if (newWorkspace.type === "team") {
|
||||||
const team = myTeams.value?.find((t) => t.id === newWorkspace.teamID)
|
const team = myTeams.value?.find((t) => t.id === newWorkspace.teamID)
|
||||||
updateSelectedTeam(team)
|
updateSelectedTeam(team)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/selfhost-web",
|
"name": "@hoppscotch/selfhost-web",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-sh-admin",
|
"name": "hoppscotch-sh-admin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.4.2",
|
"version": "2023.4.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
||||||
|
|||||||
Reference in New Issue
Block a user