integrated front and back
This commit is contained in:
@@ -1,10 +1,23 @@
|
||||
import { state, saveState, genId } from '../state.js';
|
||||
import { renderMainScreen } from '../render/main-screen.js';
|
||||
import { showEditWorkoutDateDialog } from '../modals/edit-workout-date-modal.js';
|
||||
import { showClientSelectModal } from '../modals/client-select-modal.js';
|
||||
|
||||
export function startWorkout() {
|
||||
// В режиме тренера — сначала выбираем клиента
|
||||
if (state.mode === 'trainer') {
|
||||
showClientSelectModal((clientId) => {
|
||||
_createWorkout(clientId);
|
||||
});
|
||||
} else {
|
||||
_createWorkout(null);
|
||||
}
|
||||
}
|
||||
|
||||
function _createWorkout(clientId) {
|
||||
const w = {
|
||||
id: genId(),
|
||||
client_id: clientId,
|
||||
startTime: new Date().toISOString(),
|
||||
endTime: null,
|
||||
type: '',
|
||||
|
||||
Reference in New Issue
Block a user