Skip to content

Commit 3846683

Browse files
committed
serialize to relative url (this might be a degression)
1 parent 58676fa commit 3846683

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

packages/base/card-api.gts

+3-1
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,12 @@ class Contains<CardT extends FieldDefConstructor> implements Field<CardT, any> {
697697
serialize(
698698
value: InstanceType<CardT>,
699699
doc: JSONAPISingleResourceDocument,
700+
_visited: Set<string>,
701+
opts?: SerializeOpts,
700702
): JSONAPIResource {
701703
let serialized: JSONAPISingleResourceDocument['data'] & {
702704
meta: Record<string, any>;
703-
} = callSerializeHook(this.card, value, doc);
705+
} = callSerializeHook(this.card, value, doc, undefined, opts);
704706
if (primitive in this.card) {
705707
return { attributes: { [this.name]: serialized } };
706708
} else {

packages/host/app/services/card-service.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,7 @@ export default class CardService extends Service {
209209
let api = await this.getAPI();
210210
try {
211211
api.subscribeToChanges(card, onCardChange);
212-
let doc = await this.serializeCard(card, {
213-
// for a brand new card that has no id yet, we don't know what we are
214-
// relativeTo because its up to the realm server to assign us an ID, so
215-
// URL's should be absolute
216-
maybeRelativeURL: null, // forces URL's to be absolute.
217-
});
212+
let doc = await this.serializeCard(card);
218213
// send doc over the wire with absolute URL's. The realm server will convert
219214
// to relative URL's as it serializes the cards
220215
let realmURL = await this.getRealmURL(card);

0 commit comments

Comments
 (0)