updated code of prajakta block,payment, gst
This commit is contained in:
@@ -1,34 +1,11 @@
|
||||
from flask import Blueprint, render_template, request, redirect, url_for, jsonify
|
||||
from flask_login import login_required
|
||||
from model.Subcontractor import Subcontractor
|
||||
from model.Utilities import HtmlHelper, ResponseHandler
|
||||
|
||||
|
||||
subcontractor_bp = Blueprint('subcontractor', __name__)
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# Helpers (unchanged)
|
||||
# ----------------------------------------------------------
|
||||
class HtmlHelper:
|
||||
@staticmethod
|
||||
def json_response(data, status=200):
|
||||
return jsonify(data), status
|
||||
|
||||
class ResponseHandler:
|
||||
@staticmethod
|
||||
def fetch_failure(entity):
|
||||
return {"status": "error", "message": f"Failed to fetch {entity}"}
|
||||
|
||||
@staticmethod
|
||||
def add_failure(entity):
|
||||
return {"status": "error", "message": f"Failed to add {entity}"}
|
||||
|
||||
@staticmethod
|
||||
def update_failure(entity):
|
||||
return {"status": "error", "message": f"Failed to update {entity}"}
|
||||
|
||||
@staticmethod
|
||||
def delete_failure(entity):
|
||||
return {"status": "error", "message": f"Failed to delete {entity}"}
|
||||
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST + ADD
|
||||
|
||||
Reference in New Issue
Block a user