summaryrefslogtreecommitdiff
path: root/frontend/src/actions/portfolios.js
blob: d37886d89799695881802606105a033ed0c7b4e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export const ADD_PORTFOLIO = 'ADD_PORTFOLIO'
export const UPDATE_PORTFOLIO = 'UPDATE_PORTFOLIO'
export const DELETE_PORTFOLIO = 'DELETE_PORTFOLIO'
export const OPEN_PORTFOLIO_SUCCEEDED = 'OPEN_PORTFOLIO_SUCCEEDED'
export const SET_CURRENT_PORTFOLIO = 'SET_CURRENT_PORTFOLIO'

export function addPortfolio(portfolio) {
    return {
        type: ADD_PORTFOLIO,
        portfolio,
    }
}

export function updatePortfolio(portfolio) {
    return {
        type: UPDATE_PORTFOLIO,
        portfolio,
    }
}

export function deletePortfolio(id) {
    return {
        type: DELETE_PORTFOLIO,
        id,
    }
}

export function openPortfolioSucceeded(projectId, portfolioId) {
    return {
        type: OPEN_PORTFOLIO_SUCCEEDED,
        projectId,
        portfolioId,
    }
}

export function setCurrentPortfolio(portfolioId) {
    return {
        type: SET_CURRENT_PORTFOLIO,
        portfolioId,
    }
}