mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-01 23:40:25 +00:00
* Removed lingering checklist * Added another party data check * Added move cursor on hover * Removed task locally * Prevented user from being able to delete an active challenge task * Reset tasks when viewing member progress * Prevented challenge owners from adding checklists * Hide challenges columns with no tasks * Add error translations * Added markdown to challenge description * Allowed leader to rejoin challenge * Replaced description with summary * Fixed delete logic * Added author * Added loading message * Added load more * Added default sub * Fixed remove all * Added lint
29 lines
752 B
JavaScript
29 lines
752 B
JavaScript
import axios from 'axios';
|
|
import * as Analytics from 'client/libs/analytics';
|
|
|
|
// export async function initQuest (store) {
|
|
// }
|
|
|
|
export async function sendAction (store, payload) {
|
|
// @TODO: Maybe move this to server
|
|
let partyData = {
|
|
partyID: store.state.user.data.party._id,
|
|
partySize: store.state.party.members.data.length,
|
|
};
|
|
|
|
if (store.state.party && store.state.party.data) {
|
|
partyData = {
|
|
partyID: store.state.party.data._id,
|
|
partySize: store.state.party.data.memberCount,
|
|
};
|
|
}
|
|
|
|
Analytics.updateUser(partyData);
|
|
|
|
let response = await axios.post(`/api/v3/groups/${payload.groupId}/${payload.action}`);
|
|
|
|
// @TODO: Update user?
|
|
// User.sync();
|
|
|
|
return response.data.quest || response.data.data;
|
|
}
|