chore: Remove hostname param from controller (#39768)

## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

/test Sanity

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13921602542>
> Commit: 4999b394e04e884b724fa65d4b345c0edcbe3c39
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13921602542&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Tue, 18 Mar 2025 11:38:43 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Streamlined workspace retrieval by removing an unnecessary hostname
input. Users will continue to see their workspaces displayed as before.

- **Tests**
- Updated test cases to match the revised workflow for fetching
workspaces, ensuring consistent behavior with the changes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Abhijeet 2025-03-19 10:45:47 +05:30 committed by GitHub
parent 1133d6d8dd
commit d96fcae0d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 7 deletions

View File

@ -105,10 +105,9 @@ public class WorkspaceControllerCE {
@JsonView(Views.Public.class)
@GetMapping("/home")
public Mono<ResponseDTO<List<Workspace>>> workspacesForHome(
@RequestHeader(name = "Host", required = false) String hostname) {
public Mono<ResponseDTO<List<Workspace>>> workspacesForHome() {
return userWorkspaceService
.getUserWorkspacesByRecentlyUsedOrder(hostname)
.getUserWorkspacesByRecentlyUsedOrder()
.map(workspaces -> new ResponseDTO<>(HttpStatus.OK, workspaces));
}
}

View File

@ -24,5 +24,5 @@ public interface UserWorkspaceServiceCE {
Mono<Boolean> isLastAdminRoleEntity(PermissionGroup permissionGroup);
Mono<List<Workspace>> getUserWorkspacesByRecentlyUsedOrder(String hostname);
Mono<List<Workspace>> getUserWorkspacesByRecentlyUsedOrder();
}

View File

@ -398,7 +398,7 @@ public class UserWorkspaceServiceCEImpl implements UserWorkspaceServiceCE {
* @return Mono of list of workspaces
*/
@Override
public Mono<List<Workspace>> getUserWorkspacesByRecentlyUsedOrder(String hostname) {
public Mono<List<Workspace>> getUserWorkspacesByRecentlyUsedOrder() {
Mono<List<String>> workspaceIdsMono = userDataService
.getForCurrentUser()

View File

@ -248,7 +248,7 @@ public class UserWorkspaceServiceUnitTest {
cleanup();
createDummyWorkspaces().blockLast();
StepVerifier.create(userWorkspaceService.getUserWorkspacesByRecentlyUsedOrder(null))
StepVerifier.create(userWorkspaceService.getUserWorkspacesByRecentlyUsedOrder())
.assertNext(workspaces -> {
assertThat(workspaces).hasSize(4);
workspaces.forEach(workspace -> {
@ -275,7 +275,7 @@ public class UserWorkspaceServiceUnitTest {
userData.setRecentlyUsedEntityIds(recentlyUsedEntityDTOs);
doReturn(Mono.just(userData)).when(userDataService).getForCurrentUser();
StepVerifier.create(userWorkspaceService.getUserWorkspacesByRecentlyUsedOrder(null))
StepVerifier.create(userWorkspaceService.getUserWorkspacesByRecentlyUsedOrder())
.assertNext(workspaces -> {
assertThat(workspaces).hasSize(4);
List<String> fetchedWorkspaceIds = new ArrayList<>();