Function sentry::routes::campaign::close_campaign
source · pub async fn close_campaign<C: Locked + 'static>(
__arg0: Extension<Arc<Application<C>>>,
__arg1: Extension<Auth>,
__arg2: Extension<ChainOf<Campaign>>
) -> Result<Json<SuccessResponse>, ResponseError>
Expand description
POST /v5/campaign/:id/close
(auth required)
Can only be called by the [Campaign.creator
]!
To close a campaign, just set it’s budget to what it’s spent so far (so that remaining == 0)
newBudget = totalSpent, i.e. newBudget = oldBudget - remaining