market implement

This commit is contained in:
2026-04-21 20:24:17 +03:00
parent c41eebac87
commit a6af694482
6 changed files with 107 additions and 9 deletions

View File

@@ -93,13 +93,15 @@ def get_pending_command():
build_cmd = _fetch_pending_of_type(c, 'build')
recruit_cmd = _fetch_pending_of_type(c, 'recruit')
market_cmd = _fetch_pending_of_type(c, 'market_offer')
conn.commit()
conn.close()
return jsonify({
'build': build_cmd,
'recruit': recruit_cmd
'recruit': recruit_cmd,
'market': market_cmd
})

View File

@@ -144,8 +144,8 @@ def create_command():
return jsonify({'error': f'missing field: {field}'}), 400
cmd_type = data['type']
if cmd_type not in ('build', 'recruit'):
return jsonify({'error': 'type must be build or recruit'}), 400
if cmd_type not in ('build', 'recruit', 'market_offer'):
return jsonify({'error': 'type must be build, recruit, or market_offer'}), 400
# Reject if the Tampermonkey client is offline (no state push in last 150 s)
conn = get_db()