TryGhost/Ghost

View on GitHub
ghost/admin/app/serializers/tier.js

Summary

Maintainability
A
0 mins
Test Coverage
import ApplicationSerializer from './application';

export default class TierSerializer extends ApplicationSerializer {
    serialize() {
        let json = super.serialize(...arguments);

        if (json?.monthly_price) {
            json.monthly_price = Math.round(json.monthly_price);
        }

        if (json?.yearly_price) {
            json.yearly_price = Math.round(json.yearly_price);
        }

        return json;
    }
}