You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
888 B
34 lines
888 B
<script>
|
|
import pluralize from "pluralize";
|
|
import ModalFrame from "../components/ModalFrame";
|
|
|
|
import modal from "../stores/modal";
|
|
import stufflog from "../stores/stufflog";
|
|
|
|
export let period = {};
|
|
export let goal = {};
|
|
export let activity = {};
|
|
let error = null;
|
|
|
|
function removePeriodLog() {
|
|
stufflog.updatePeriod(period.id, {removeGoal: goal.id}).then(() => {
|
|
modal.close();
|
|
}).catch(err => {
|
|
error = err.message || err;
|
|
console.warn(err);
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<ModalFrame title={`Remove ${period.name} Goal`} error={error} closable on:close={() => modal.close()}>
|
|
<form on:submit|preventDefault={() => removePeriodLog()}>
|
|
<p>
|
|
Are you sure you want to remove <b>{activity.name}</b> goal from
|
|
period <b>{period.name}</b>?
|
|
</p>
|
|
|
|
<hr />
|
|
|
|
<button type="submit">Yes, do as I say</button>
|
|
</form>
|
|
</ModalFrame>
|