mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 17:42:57 +00:00
refactor: use enumeration for the type of an origin
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 StApps
|
* Copyright (C) 2018, 2019 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -96,7 +96,13 @@ export interface SCThing {
|
|||||||
url?: string;
|
url?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SCThingOriginType = 'remote' | 'user';
|
/**
|
||||||
|
* Possible types of an origin
|
||||||
|
*/
|
||||||
|
export enum SCThingOriginType {
|
||||||
|
Remote = 'remote',
|
||||||
|
User = 'user',
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Origin of a thing
|
* Origin of a thing
|
||||||
@@ -149,7 +155,7 @@ export interface SCThingRemoteOrigin extends SCThingOrigin {
|
|||||||
/**
|
/**
|
||||||
* Type of the origin
|
* Type of the origin
|
||||||
*/
|
*/
|
||||||
type: 'remote';
|
type: SCThingOriginType.Remote;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main URL of the origin
|
* Main URL of the origin
|
||||||
@@ -174,7 +180,7 @@ export interface SCThingUserOrigin extends SCThingOrigin {
|
|||||||
/**
|
/**
|
||||||
* Type of the origin
|
* Type of the origin
|
||||||
*/
|
*/
|
||||||
type: 'user';
|
type: SCThingOriginType.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When the saved thing was last updated with the latest state (e.g. from the backend)
|
* When the saved thing was last updated with the latest state (e.g. from the backend)
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ export type SCFavoriteDataTypes = SCAcademicEventWithoutReferences
|
|||||||
* @validatable
|
* @validatable
|
||||||
*/
|
*/
|
||||||
export interface SCFavorite extends SCSaveableThing<SCFavoriteDataTypes> {
|
export interface SCFavorite extends SCSaveableThing<SCFavoriteDataTypes> {
|
||||||
|
/**
|
||||||
|
* Type of a favorite
|
||||||
|
*/
|
||||||
type: SCThingType.Favorite;
|
type: SCThingType.Favorite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user