# Bug OP-18371 - Workspace not updated in API after favoring it

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-18371

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | API |
| Target versions | 17.0.0 |
| Observed in versions |  |
| Sprint | 17.0.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Jens Ulferts |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Have workspace (of any type)
    
2.  Fetch it via `GET api/v3/workspaces/:id`
    
    1.  See that it is not favorited
        
3.  Favor it via `POST api/v3/workspaces/:id/favorite`
    
4.  Fetch the workspace again
    
5.  Unfavor it via `DELETE api/v3/workspaces/:id/favorite`
    
6.  Fetch the workspace again
    

### What is the buggy behavior?

*   In step 4 it is marked as `favorite: false` which is incorrect
    
*   in step 6, it is mared as `favorite: false` which is correct but not when knowing that it was marked as favorited in between.
    

### What is the expected behavior?

1.  In step 4 it is marked as `favorite: true`
    
2.  in step 6, it is mared as `favorite: false`
