Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #537 from OpenBazaar/listing-slug
Browse files Browse the repository at this point in the history
Listing slug
  • Loading branch information
jjeffryes authored Jun 28, 2017
2 parents 7ab9ec8 + b5823dd commit 8150415
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/models/listing/Listing.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export default class extends BaseModel {
app.getServerUrl(`ob/listing/${this.guid}/${slug}`);
}
} else {

if (method !== 'delete') {
options.url = options.url || app.getServerUrl('ob/listing/');
// it's a create or update
Expand Down Expand Up @@ -228,11 +227,12 @@ export default class extends BaseModel {
if (method === 'create' || method === 'update') {
const attrsBeforeSync = this.lastSyncedAttrs;

returnSync.done(() => {
returnSync.done(data => {
const hasChanged = () => (!_.isEqual(attrsBeforeSync, this.toJSON()));

// todo: Put in a changedAttrs function that includes
// which attrs have changed.
if (data.slug) {
this.set('slug', data.slug);
}

listingEvents.trigger('saved', this, {
...eventOpts,
Expand Down

0 comments on commit 8150415

Please sign in to comment.